12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html lang="en">
- <head>
- <title>Source code</title>
- <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
- </head>
- <body>
- <div class="sourceContainer">
- <pre><span class="sourceLineNo">001</span>/* ===========================================================<a name="line.1"></a>
- <span class="sourceLineNo">002</span> * JFreeChart : a free chart library for the Java(tm) platform<a name="line.2"></a>
- <span class="sourceLineNo">003</span> * ===========================================================<a name="line.3"></a>
- <span class="sourceLineNo">004</span> *<a name="line.4"></a>
- <span class="sourceLineNo">005</span> * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.<a name="line.5"></a>
- <span class="sourceLineNo">006</span> *<a name="line.6"></a>
- <span class="sourceLineNo">007</span> * Project Info: http://www.jfree.org/jfreechart/index.html<a name="line.7"></a>
- <span class="sourceLineNo">008</span> *<a name="line.8"></a>
- <span class="sourceLineNo">009</span> * This library is free software; you can redistribute it and/or modify it<a name="line.9"></a>
- <span class="sourceLineNo">010</span> * under the terms of the GNU Lesser General Public License as published by<a name="line.10"></a>
- <span class="sourceLineNo">011</span> * the Free Software Foundation; either version 2.1 of the License, or<a name="line.11"></a>
- <span class="sourceLineNo">012</span> * (at your option) any later version.<a name="line.12"></a>
- <span class="sourceLineNo">013</span> *<a name="line.13"></a>
- <span class="sourceLineNo">014</span> * This library is distributed in the hope that it will be useful, but<a name="line.14"></a>
- <span class="sourceLineNo">015</span> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY<a name="line.15"></a>
- <span class="sourceLineNo">016</span> * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public<a name="line.16"></a>
- <span class="sourceLineNo">017</span> * License for more details.<a name="line.17"></a>
- <span class="sourceLineNo">018</span> *<a name="line.18"></a>
- <span class="sourceLineNo">019</span> * You should have received a copy of the GNU Lesser General Public<a name="line.19"></a>
- <span class="sourceLineNo">020</span> * License along with this library; if not, write to the Free Software<a name="line.20"></a>
- <span class="sourceLineNo">021</span> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,<a name="line.21"></a>
- <span class="sourceLineNo">022</span> * USA.<a name="line.22"></a>
- <span class="sourceLineNo">023</span> *<a name="line.23"></a>
- <span class="sourceLineNo">024</span> * [Oracle and Java are registered trademarks of Oracle and/or its affiliates.<a name="line.24"></a>
- <span class="sourceLineNo">025</span> * Other names may be trademarks of their respective owners.]<a name="line.25"></a>
- <span class="sourceLineNo">026</span> *<a name="line.26"></a>
- <span class="sourceLineNo">027</span> * -----------<a name="line.27"></a>
- <span class="sourceLineNo">028</span> * XYPlot.java<a name="line.28"></a>
- <span class="sourceLineNo">029</span> * -----------<a name="line.29"></a>
- <span class="sourceLineNo">030</span> * (C) Copyright 2000-2014, by Object Refinery Limited and Contributors.<a name="line.30"></a>
- <span class="sourceLineNo">031</span> *<a name="line.31"></a>
- <span class="sourceLineNo">032</span> * Original Author: David Gilbert (for Object Refinery Limited);<a name="line.32"></a>
- <span class="sourceLineNo">033</span> * Contributor(s): Craig MacFarlane;<a name="line.33"></a>
- <span class="sourceLineNo">034</span> * Mark Watson (www.markwatson.com);<a name="line.34"></a>
- <span class="sourceLineNo">035</span> * Jonathan Nash;<a name="line.35"></a>
- <span class="sourceLineNo">036</span> * Gideon Krause;<a name="line.36"></a>
- <span class="sourceLineNo">037</span> * Klaus Rheinwald;<a name="line.37"></a>
- <span class="sourceLineNo">038</span> * Xavier Poinsard;<a name="line.38"></a>
- <span class="sourceLineNo">039</span> * Richard Atkinson;<a name="line.39"></a>
- <span class="sourceLineNo">040</span> * Arnaud Lelievre;<a name="line.40"></a>
- <span class="sourceLineNo">041</span> * Nicolas Brodu;<a name="line.41"></a>
- <span class="sourceLineNo">042</span> * Eduardo Ramalho;<a name="line.42"></a>
- <span class="sourceLineNo">043</span> * Sergei Ivanov;<a name="line.43"></a>
- <span class="sourceLineNo">044</span> * Richard West, Advanced Micro Devices, Inc.;<a name="line.44"></a>
- <span class="sourceLineNo">045</span> * Ulrich Voigt - patches 1997549 and 2686040;<a name="line.45"></a>
- <span class="sourceLineNo">046</span> * Peter Kolb - patches 1934255, 2603321 and 2809117;<a name="line.46"></a>
- <span class="sourceLineNo">047</span> * Andrew Mickish - patch 1868749;<a name="line.47"></a>
- <span class="sourceLineNo">048</span> *<a name="line.48"></a>
- <span class="sourceLineNo">049</span> * Changes (from 21-Jun-2001)<a name="line.49"></a>
- <span class="sourceLineNo">050</span> * --------------------------<a name="line.50"></a>
- <span class="sourceLineNo">051</span> * 21-Jun-2001 : Removed redundant JFreeChart parameter from constructors (DG);<a name="line.51"></a>
- <span class="sourceLineNo">052</span> * 18-Sep-2001 : Updated header and fixed DOS encoding problem (DG);<a name="line.52"></a>
- <span class="sourceLineNo">053</span> * 15-Oct-2001 : Data source classes moved to com.jrefinery.data.* (DG);<a name="line.53"></a>
- <span class="sourceLineNo">054</span> * 19-Oct-2001 : Removed the code for drawing the visual representation of each<a name="line.54"></a>
- <span class="sourceLineNo">055</span> * data point into a separate class StandardXYItemRenderer.<a name="line.55"></a>
- <span class="sourceLineNo">056</span> * This will make it easier to add variations to the way the<a name="line.56"></a>
- <span class="sourceLineNo">057</span> * charts are drawn. Based on code contributed by Mark<a name="line.57"></a>
- <span class="sourceLineNo">058</span> * Watson (DG);<a name="line.58"></a>
- <span class="sourceLineNo">059</span> * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG);<a name="line.59"></a>
- <span class="sourceLineNo">060</span> * 20-Nov-2001 : Fixed clipping bug that shows up when chart is displayed<a name="line.60"></a>
- <span class="sourceLineNo">061</span> * inside JScrollPane (DG);<a name="line.61"></a>
- <span class="sourceLineNo">062</span> * 12-Dec-2001 : Removed unnecessary 'throws' clauses from constructor (DG);<a name="line.62"></a>
- <span class="sourceLineNo">063</span> * 13-Dec-2001 : Added skeleton code for tooltips. Added new constructor. (DG);<a name="line.63"></a>
- <span class="sourceLineNo">064</span> * 16-Jan-2002 : Renamed the tooltips class (DG);<a name="line.64"></a>
- <span class="sourceLineNo">065</span> * 22-Jan-2002 : Added DrawInfo class, incorporating tooltips and crosshairs.<a name="line.65"></a>
- <span class="sourceLineNo">066</span> * Crosshairs based on code by Jonathan Nash (DG);<a name="line.66"></a>
- <span class="sourceLineNo">067</span> * 05-Feb-2002 : Added alpha-transparency setting based on code by Sylvain<a name="line.67"></a>
- <span class="sourceLineNo">068</span> * Vieujot (DG);<a name="line.68"></a>
- <span class="sourceLineNo">069</span> * 26-Feb-2002 : Updated getMinimumXXX() and getMaximumXXX() methods to handle<a name="line.69"></a>
- <span class="sourceLineNo">070</span> * special case when chart is null (DG);<a name="line.70"></a>
- <span class="sourceLineNo">071</span> * 28-Feb-2002 : Renamed Datasets.java --> DatasetUtilities.java (DG);<a name="line.71"></a>
- <span class="sourceLineNo">072</span> * 28-Mar-2002 : The plot now registers with the renderer as a property change<a name="line.72"></a>
- <span class="sourceLineNo">073</span> * listener. Also added a new constructor (DG);<a name="line.73"></a>
- <span class="sourceLineNo">074</span> * 09-Apr-2002 : Removed the transRangeZero from the renderer.drawItem()<a name="line.74"></a>
- <span class="sourceLineNo">075</span> * method. Moved the tooltip generator into the renderer (DG);<a name="line.75"></a>
- <span class="sourceLineNo">076</span> * 23-Apr-2002 : Fixed bug in methods for drawing horizontal and vertical<a name="line.76"></a>
- <span class="sourceLineNo">077</span> * lines (DG);<a name="line.77"></a>
- <span class="sourceLineNo">078</span> * 13-May-2002 : Small change to the draw() method so that it works for<a name="line.78"></a>
- <span class="sourceLineNo">079</span> * OverlaidXYPlot also (DG);<a name="line.79"></a>
- <span class="sourceLineNo">080</span> * 25-Jun-2002 : Removed redundant import (DG);<a name="line.80"></a>
- <span class="sourceLineNo">081</span> * 20-Aug-2002 : Renamed getItemRenderer() --> getRenderer(), and<a name="line.81"></a>
- <span class="sourceLineNo">082</span> * setXYItemRenderer() --> setRenderer() (DG);<a name="line.82"></a>
- <span class="sourceLineNo">083</span> * 28-Aug-2002 : Added mechanism for (optional) plot annotations (DG);<a name="line.83"></a>
- <span class="sourceLineNo">084</span> * 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);<a name="line.84"></a>
- <span class="sourceLineNo">085</span> * 18-Nov-2002 : Added grid settings for both domain and range axis (previously<a name="line.85"></a>
- <span class="sourceLineNo">086</span> * these were set in the axes) (DG);<a name="line.86"></a>
- <span class="sourceLineNo">087</span> * 09-Jan-2003 : Further additions to the grid settings, plus integrated plot<a name="line.87"></a>
- <span class="sourceLineNo">088</span> * border bug fix contributed by Gideon Krause (DG);<a name="line.88"></a>
- <span class="sourceLineNo">089</span> * 22-Jan-2003 : Removed monolithic constructor (DG);<a name="line.89"></a>
- <span class="sourceLineNo">090</span> * 04-Mar-2003 : Added 'no data' message, see bug report 691634. Added<a name="line.90"></a>
- <span class="sourceLineNo">091</span> * secondary range markers using code contributed by Klaus<a name="line.91"></a>
- <span class="sourceLineNo">092</span> * Rheinwald (DG);<a name="line.92"></a>
- <span class="sourceLineNo">093</span> * 26-Mar-2003 : Implemented Serializable (DG);<a name="line.93"></a>
- <span class="sourceLineNo">094</span> * 03-Apr-2003 : Added setDomainAxisLocation() method (DG);<a name="line.94"></a>
- <span class="sourceLineNo">095</span> * 30-Apr-2003 : Moved annotation drawing into a separate method (DG);<a name="line.95"></a>
- <span class="sourceLineNo">096</span> * 01-May-2003 : Added multi-pass mechanism for renderers (DG);<a name="line.96"></a>
- <span class="sourceLineNo">097</span> * 02-May-2003 : Changed axis locations from int to AxisLocation (DG);<a name="line.97"></a>
- <span class="sourceLineNo">098</span> * 15-May-2003 : Added an orientation attribute (DG);<a name="line.98"></a>
- <span class="sourceLineNo">099</span> * 02-Jun-2003 : Removed range axis compatibility test (DG);<a name="line.99"></a>
- <span class="sourceLineNo">100</span> * 05-Jun-2003 : Added domain and range grid bands (sponsored by Focus Computer<a name="line.100"></a>
- <span class="sourceLineNo">101</span> * Services Ltd) (DG);<a name="line.101"></a>
- <span class="sourceLineNo">102</span> * 26-Jun-2003 : Fixed bug (757303) in getDataRange() method (DG);<a name="line.102"></a>
- <span class="sourceLineNo">103</span> * 02-Jul-2003 : Added patch from bug report 698646 (secondary axes for<a name="line.103"></a>
- <span class="sourceLineNo">104</span> * overlaid plots) (DG);<a name="line.104"></a>
- <span class="sourceLineNo">105</span> * 23-Jul-2003 : Added support for multiple secondary datasets, axes and<a name="line.105"></a>
- <span class="sourceLineNo">106</span> * renderers (DG);<a name="line.106"></a>
- <span class="sourceLineNo">107</span> * 27-Jul-2003 : Added support for stacked XY area charts (RA);<a name="line.107"></a>
- <span class="sourceLineNo">108</span> * 19-Aug-2003 : Implemented Cloneable (DG);<a name="line.108"></a>
- <span class="sourceLineNo">109</span> * 01-Sep-2003 : Fixed bug where change to secondary datasets didn't generate<a name="line.109"></a>
- <span class="sourceLineNo">110</span> * change event (797466) (DG)<a name="line.110"></a>
- <span class="sourceLineNo">111</span> * 08-Sep-2003 : Added internationalization via use of properties<a name="line.111"></a>
- <span class="sourceLineNo">112</span> * resourceBundle (RFE 690236) (AL);<a name="line.112"></a>
- <span class="sourceLineNo">113</span> * 08-Sep-2003 : Changed ValueAxis API (DG);<a name="line.113"></a>
- <span class="sourceLineNo">114</span> * 08-Sep-2003 : Fixes for serialization (NB);<a name="line.114"></a>
- <span class="sourceLineNo">115</span> * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG);<a name="line.115"></a>
- <span class="sourceLineNo">116</span> * 17-Sep-2003 : Fixed zooming to include secondary domain axes (DG);<a name="line.116"></a>
- <span class="sourceLineNo">117</span> * 18-Sep-2003 : Added getSecondaryDomainAxisCount() and<a name="line.117"></a>
- <span class="sourceLineNo">118</span> * getSecondaryRangeAxisCount() methods suggested by Eduardo<a name="line.118"></a>
- <span class="sourceLineNo">119</span> * Ramalho (RFE 808548) (DG);<a name="line.119"></a>
- <span class="sourceLineNo">120</span> * 23-Sep-2003 : Split domain and range markers into foreground and<a name="line.120"></a>
- <span class="sourceLineNo">121</span> * background (DG);<a name="line.121"></a>
- <span class="sourceLineNo">122</span> * 06-Oct-2003 : Fixed bug in clearDomainMarkers() and clearRangeMarkers()<a name="line.122"></a>
- <span class="sourceLineNo">123</span> * methods. Fixed bug (815876) in addSecondaryRangeMarker()<a name="line.123"></a>
- <span class="sourceLineNo">124</span> * method. Added new addSecondaryDomainMarker methods (see bug<a name="line.124"></a>
- <span class="sourceLineNo">125</span> * id 815869) (DG);<a name="line.125"></a>
- <span class="sourceLineNo">126</span> * 10-Nov-2003 : Added getSecondaryDomain/RangeAxisMappedToDataset() methods<a name="line.126"></a>
- <span class="sourceLineNo">127</span> * requested by Eduardo Ramalho (DG);<a name="line.127"></a>
- <span class="sourceLineNo">128</span> * 24-Nov-2003 : Removed unnecessary notification when updating axis anchor<a name="line.128"></a>
- <span class="sourceLineNo">129</span> * values (DG);<a name="line.129"></a>
- <span class="sourceLineNo">130</span> * 21-Jan-2004 : Update for renamed method in ValueAxis (DG);<a name="line.130"></a>
- <span class="sourceLineNo">131</span> * 25-Feb-2004 : Replaced CrosshairInfo with CrosshairState (DG);<a name="line.131"></a>
- <span class="sourceLineNo">132</span> * 12-Mar-2004 : Fixed bug where primary renderer is always used to determine<a name="line.132"></a>
- <span class="sourceLineNo">133</span> * range type (DG);<a name="line.133"></a>
- <span class="sourceLineNo">134</span> * 22-Mar-2004 : Fixed cloning bug (DG);<a name="line.134"></a>
- <span class="sourceLineNo">135</span> * 23-Mar-2004 : Fixed more cloning bugs (DG);<a name="line.135"></a>
- <span class="sourceLineNo">136</span> * 07-Apr-2004 : Fixed problem with axis range when the secondary renderer is<a name="line.136"></a>
- <span class="sourceLineNo">137</span> * stacked, see this post in the forum:<a name="line.137"></a>
- <span class="sourceLineNo">138</span> * http://www.jfree.org/phpBB2/viewtopic.php?t=8204 (DG);<a name="line.138"></a>
- <span class="sourceLineNo">139</span> * 07-Apr-2004 : Added get/setDatasetRenderingOrder() methods (DG);<a name="line.139"></a>
- <span class="sourceLineNo">140</span> * 26-Apr-2004 : Added option to fill quadrant areas in the background of the<a name="line.140"></a>
- <span class="sourceLineNo">141</span> * plot (DG);<a name="line.141"></a>
- <span class="sourceLineNo">142</span> * 27-Apr-2004 : Removed major distinction between primary and secondary<a name="line.142"></a>
- <span class="sourceLineNo">143</span> * datasets, renderers and axes (DG);<a name="line.143"></a>
- <span class="sourceLineNo">144</span> * 30-Apr-2004 : Modified to make use of the new getRangeExtent() method in the<a name="line.144"></a>
- <span class="sourceLineNo">145</span> * renderer interface (DG);<a name="line.145"></a>
- <span class="sourceLineNo">146</span> * 13-May-2004 : Added optional fixedLegendItems attribute (DG);<a name="line.146"></a>
- <span class="sourceLineNo">147</span> * 19-May-2004 : Added indexOf() method (DG);<a name="line.147"></a>
- <span class="sourceLineNo">148</span> * 03-Jun-2004 : Fixed zooming bug (DG);<a name="line.148"></a>
- <span class="sourceLineNo">149</span> * 18-Aug-2004 : Added removedAnnotation() method (by tkram01) (DG);<a name="line.149"></a>
- <span class="sourceLineNo">150</span> * 05-Oct-2004 : Modified storage type for dataset-to-axis maps (DG);<a name="line.150"></a>
- <span class="sourceLineNo">151</span> * 06-Oct-2004 : Modified getDataRange() method to use renderer to determine<a name="line.151"></a>
- <span class="sourceLineNo">152</span> * the x-value range (now matches behaviour for y-values). Added<a name="line.152"></a>
- <span class="sourceLineNo">153</span> * getDomainAxisIndex() method (DG);<a name="line.153"></a>
- <span class="sourceLineNo">154</span> * 12-Nov-2004 : Implemented new Zoomable interface (DG);<a name="line.154"></a>
- <span class="sourceLineNo">155</span> * 25-Nov-2004 : Small update to clone() implementation (DG);<a name="line.155"></a>
- <span class="sourceLineNo">156</span> * 22-Feb-2005 : Changed axis offsets from Spacer --> RectangleInsets (DG);<a name="line.156"></a>
- <span class="sourceLineNo">157</span> * 24-Feb-2005 : Added indexOf(XYItemRenderer) method (DG);<a name="line.157"></a>
- <span class="sourceLineNo">158</span> * 21-Mar-2005 : Register plot as change listener in setRenderer() method (DG);<a name="line.158"></a>
- <span class="sourceLineNo">159</span> * 21-Apr-2005 : Added get/setSeriesRenderingOrder() methods (ET);<a name="line.159"></a>
- <span class="sourceLineNo">160</span> * 26-Apr-2005 : Removed LOGGER (DG);<a name="line.160"></a>
- <span class="sourceLineNo">161</span> * 04-May-2005 : Fixed serialization of domain and range markers (DG);<a name="line.161"></a>
- <span class="sourceLineNo">162</span> * 05-May-2005 : Removed unused draw() method (DG);<a name="line.162"></a>
- <span class="sourceLineNo">163</span> * 20-May-2005 : Added setDomainAxes() and setRangeAxes() methods, as per<a name="line.163"></a>
- <span class="sourceLineNo">164</span> * RFE 1183100 (DG);<a name="line.164"></a>
- <span class="sourceLineNo">165</span> * 01-Jun-2005 : Upon deserialization, register plot as a listener with its<a name="line.165"></a>
- <span class="sourceLineNo">166</span> * axes, dataset(s) and renderer(s) - see patch 1209475 (DG);<a name="line.166"></a>
- <span class="sourceLineNo">167</span> * 01-Jun-2005 : Added clearDomainMarkers(int) method to match<a name="line.167"></a>
- <span class="sourceLineNo">168</span> * clearRangeMarkers(int) (DG);<a name="line.168"></a>
- <span class="sourceLineNo">169</span> * 06-Jun-2005 : Fixed equals() method to handle GradientPaint (DG);<a name="line.169"></a>
- <span class="sourceLineNo">170</span> * 09-Jun-2005 : Added setRenderers(), as per RFE 1183100 (DG);<a name="line.170"></a>
- <span class="sourceLineNo">171</span> * 06-Jul-2005 : Fixed crosshair bug (id = 1233336) (DG);<a name="line.171"></a>
- <span class="sourceLineNo">172</span> * ------------- JFREECHART 1.0.x ---------------------------------------------<a name="line.172"></a>
- <span class="sourceLineNo">173</span> * 26-Jan-2006 : Added getAnnotations() method (DG);<a name="line.173"></a>
- <span class="sourceLineNo">174</span> * 05-Sep-2006 : Added MarkerChangeEvent support (DG);<a name="line.174"></a>
- <span class="sourceLineNo">175</span> * 13-Oct-2006 : Fixed initialisation of CrosshairState - see bug report<a name="line.175"></a>
- <span class="sourceLineNo">176</span> * 1565168 (DG);<a name="line.176"></a>
- <span class="sourceLineNo">177</span> * 22-Nov-2006 : Fixed equals() and cloning() for quadrant attributes, plus<a name="line.177"></a>
- <span class="sourceLineNo">178</span> * API doc updates (DG);<a name="line.178"></a>
- <span class="sourceLineNo">179</span> * 29-Nov-2006 : Added argument checks (DG);<a name="line.179"></a>
- <span class="sourceLineNo">180</span> * 15-Jan-2007 : Fixed bug in drawRangeMarkers() (DG);<a name="line.180"></a>
- <span class="sourceLineNo">181</span> * 07-Feb-2007 : Fixed bug 1654215, renderer with no dataset (DG);<a name="line.181"></a>
- <span class="sourceLineNo">182</span> * 26-Feb-2007 : Added missing setDomainAxisLocation() and<a name="line.182"></a>
- <span class="sourceLineNo">183</span> * setRangeAxisLocation() methods (DG);<a name="line.183"></a>
- <span class="sourceLineNo">184</span> * 02-Mar-2007 : Fix for crosshair positioning with horizontal orientation<a name="line.184"></a>
- <span class="sourceLineNo">185</span> * (see patch 1671648 by Sergei Ivanov) (DG);<a name="line.185"></a>
- <span class="sourceLineNo">186</span> * 13-Mar-2007 : Added null argument checks for crosshair attributes (DG);<a name="line.186"></a>
- <span class="sourceLineNo">187</span> * 23-Mar-2007 : Added domain zero base line facility (DG);<a name="line.187"></a>
- <span class="sourceLineNo">188</span> * 04-May-2007 : Render only visible data items if possible (DG);<a name="line.188"></a>
- <span class="sourceLineNo">189</span> * 24-May-2007 : Fixed bug in render method for an empty series (DG);<a name="line.189"></a>
- <span class="sourceLineNo">190</span> * 07-Jun-2007 : Modified drawBackground() to pass orientation to<a name="line.190"></a>
- <span class="sourceLineNo">191</span> * fillBackground() for handling GradientPaint (DG);<a name="line.191"></a>
- <span class="sourceLineNo">192</span> * 24-Sep-2007 : Added new zoom methods (DG);<a name="line.192"></a>
- <span class="sourceLineNo">193</span> * 26-Sep-2007 : Include index value in IllegalArgumentExceptions (DG);<a name="line.193"></a>
- <span class="sourceLineNo">194</span> * 05-Nov-2007 : Applied patch 1823697, by Richard West, for removal of domain<a name="line.194"></a>
- <span class="sourceLineNo">195</span> * and range markers (DG);<a name="line.195"></a>
- <span class="sourceLineNo">196</span> * 12-Nov-2007 : Fixed bug in equals() method for domain and range tick<a name="line.196"></a>
- <span class="sourceLineNo">197</span> * band paint attributes (DG);<a name="line.197"></a>
- <span class="sourceLineNo">198</span> * 27-Nov-2007 : Added new setFixedDomain/RangeAxisSpace() methods (DG);<a name="line.198"></a>
- <span class="sourceLineNo">199</span> * 04-Jan-2008 : Fix for quadrant painting error - see patch 1849564 (DG);<a name="line.199"></a>
- <span class="sourceLineNo">200</span> * 25-Mar-2008 : Added new methods with optional notification - see patch<a name="line.200"></a>
- <span class="sourceLineNo">201</span> * 1913751 (DG);<a name="line.201"></a>
- <span class="sourceLineNo">202</span> * 07-Apr-2008 : Fixed NPE in removeDomainMarker() and<a name="line.202"></a>
- <span class="sourceLineNo">203</span> * removeRangeMarker() (DG);<a name="line.203"></a>
- <span class="sourceLineNo">204</span> * 22-May-2008 : Modified calculateAxisSpace() to process range axes first,<a name="line.204"></a>
- <span class="sourceLineNo">205</span> * then adjust the plot area before calculating the space<a name="line.205"></a>
- <span class="sourceLineNo">206</span> * for the domain axes (DG);<a name="line.206"></a>
- <span class="sourceLineNo">207</span> * 09-Jul-2008 : Added renderer state notification when series pass begins<a name="line.207"></a>
- <span class="sourceLineNo">208</span> * and ends - see patch 1997549 by Ulrich Voigt (DG);<a name="line.208"></a>
- <span class="sourceLineNo">209</span> * 25-Jul-2008 : Fixed NullPointerException for plots with no axes (DG);<a name="line.209"></a>
- <span class="sourceLineNo">210</span> * 15-Aug-2008 : Added getRendererCount() method (DG);<a name="line.210"></a>
- <span class="sourceLineNo">211</span> * 25-Sep-2008 : Added minor tick support, see patch 1934255 by Peter Kolb (DG);<a name="line.211"></a>
- <span class="sourceLineNo">212</span> * 25-Nov-2008 : Allow datasets to be mapped to multiple axes - based on patch<a name="line.212"></a>
- <span class="sourceLineNo">213</span> * 1868749 by Andrew Mickish (DG);<a name="line.213"></a>
- <span class="sourceLineNo">214</span> * 18-Dec-2008 : Use ResourceBundleWrapper - see patch 1607918 by<a name="line.214"></a>
- <span class="sourceLineNo">215</span> * Jess Thrysoee (DG);<a name="line.215"></a>
- <span class="sourceLineNo">216</span> * 10-Mar-2009 : Allow some annotations to contribute to axis autoRange (DG);<a name="line.216"></a>
- <span class="sourceLineNo">217</span> * 18-Mar-2009 : Modified anchored zoom behaviour and fixed bug in<a name="line.217"></a>
- <span class="sourceLineNo">218</span> * "process visible range" rendering (DG);<a name="line.218"></a>
- <span class="sourceLineNo">219</span> * 19-Mar-2009 : Added panning support based on patch 2686040 by Ulrich<a name="line.219"></a>
- <span class="sourceLineNo">220</span> * Voigt (DG);<a name="line.220"></a>
- <span class="sourceLineNo">221</span> * 19-Mar-2009 : Added entity support - see patch 2603321 by Peter Kolb (DG);<a name="line.221"></a>
- <span class="sourceLineNo">222</span> * 30-Mar-2009 : Delegate panning to axes (DG);<a name="line.222"></a>
- <span class="sourceLineNo">223</span> * 10-May-2009 : Added check for fixedLegendItems in equals(), and code to<a name="line.223"></a>
- <span class="sourceLineNo">224</span> * handle cloning (DG);<a name="line.224"></a>
- <span class="sourceLineNo">225</span> * 24-Jun-2009 : Added support for annotation events - see patch 2809117<a name="line.225"></a>
- <span class="sourceLineNo">226</span> * by PK (DG);<a name="line.226"></a>
- <span class="sourceLineNo">227</span> * 06-Jul-2009 : Fix for cloning of renderers - see bug 2817504 (DG)<a name="line.227"></a>
- <span class="sourceLineNo">228</span> * 10-Jul-2009 : Added optional drop shadow generator (DG);<a name="line.228"></a>
- <span class="sourceLineNo">229</span> * 18-Oct-2011 : Fix tooltip offset with shadow renderer (DG);<a name="line.229"></a>
- <span class="sourceLineNo">230</span> * 12-Sep-2013 : Check for KEY_SUPPRESS_SHADOW_GENERATION rendering hint (DG);<a name="line.230"></a>
- <span class="sourceLineNo">231</span> * 10-Mar-2014 : Updated Javadocs for issue #1123 (DG);<a name="line.231"></a>
- <span class="sourceLineNo">232</span> * 29-Jul-2014 : Add hints to normalise stroke for crosshairs (DG);<a name="line.232"></a>
- <span class="sourceLineNo">233</span> *<a name="line.233"></a>
- <span class="sourceLineNo">234</span> */<a name="line.234"></a>
- <span class="sourceLineNo">235</span><a name="line.235"></a>
- <span class="sourceLineNo">236</span>package org.jfree.chart.plot;<a name="line.236"></a>
- <span class="sourceLineNo">237</span><a name="line.237"></a>
- <span class="sourceLineNo">238</span>import java.awt.AlphaComposite;<a name="line.238"></a>
- <span class="sourceLineNo">239</span>import java.awt.BasicStroke;<a name="line.239"></a>
- <span class="sourceLineNo">240</span>import java.awt.Color;<a name="line.240"></a>
- <span class="sourceLineNo">241</span>import java.awt.Composite;<a name="line.241"></a>
- <span class="sourceLineNo">242</span>import java.awt.Graphics2D;<a name="line.242"></a>
- <span class="sourceLineNo">243</span>import java.awt.Paint;<a name="line.243"></a>
- <span class="sourceLineNo">244</span>import java.awt.Rectangle;<a name="line.244"></a>
- <span class="sourceLineNo">245</span>import java.awt.RenderingHints;<a name="line.245"></a>
- <span class="sourceLineNo">246</span>import java.awt.Shape;<a name="line.246"></a>
- <span class="sourceLineNo">247</span>import java.awt.Stroke;<a name="line.247"></a>
- <span class="sourceLineNo">248</span>import java.awt.geom.Line2D;<a name="line.248"></a>
- <span class="sourceLineNo">249</span>import java.awt.geom.Point2D;<a name="line.249"></a>
- <span class="sourceLineNo">250</span>import java.awt.geom.Rectangle2D;<a name="line.250"></a>
- <span class="sourceLineNo">251</span>import java.awt.image.BufferedImage;<a name="line.251"></a>
- <span class="sourceLineNo">252</span>import java.io.IOException;<a name="line.252"></a>
- <span class="sourceLineNo">253</span>import java.io.ObjectInputStream;<a name="line.253"></a>
- <span class="sourceLineNo">254</span>import java.io.ObjectOutputStream;<a name="line.254"></a>
- <span class="sourceLineNo">255</span>import java.io.Serializable;<a name="line.255"></a>
- <span class="sourceLineNo">256</span>import java.util.ArrayList;<a name="line.256"></a>
- <span class="sourceLineNo">257</span>import java.util.Collection;<a name="line.257"></a>
- <span class="sourceLineNo">258</span>import java.util.Collections;<a name="line.258"></a>
- <span class="sourceLineNo">259</span>import java.util.HashMap;<a name="line.259"></a>
- <span class="sourceLineNo">260</span>import java.util.HashSet;<a name="line.260"></a>
- <span class="sourceLineNo">261</span>import java.util.Iterator;<a name="line.261"></a>
- <span class="sourceLineNo">262</span>import java.util.List;<a name="line.262"></a>
- <span class="sourceLineNo">263</span>import java.util.Map;<a name="line.263"></a>
- <span class="sourceLineNo">264</span>import java.util.Map.Entry;<a name="line.264"></a>
- <span class="sourceLineNo">265</span>import java.util.ResourceBundle;<a name="line.265"></a>
- <span class="sourceLineNo">266</span>import java.util.Set;<a name="line.266"></a>
- <span class="sourceLineNo">267</span>import java.util.TreeMap;<a name="line.267"></a>
- <span class="sourceLineNo">268</span>import org.jfree.chart.JFreeChart;<a name="line.268"></a>
- <span class="sourceLineNo">269</span><a name="line.269"></a>
- <span class="sourceLineNo">270</span>import org.jfree.chart.LegendItem;<a name="line.270"></a>
- <span class="sourceLineNo">271</span>import org.jfree.chart.LegendItemCollection;<a name="line.271"></a>
- <span class="sourceLineNo">272</span>import org.jfree.chart.annotations.Annotation;<a name="line.272"></a>
- <span class="sourceLineNo">273</span>import org.jfree.chart.annotations.XYAnnotation;<a name="line.273"></a>
- <span class="sourceLineNo">274</span>import org.jfree.chart.annotations.XYAnnotationBoundsInfo;<a name="line.274"></a>
- <span class="sourceLineNo">275</span>import org.jfree.chart.axis.Axis;<a name="line.275"></a>
- <span class="sourceLineNo">276</span>import org.jfree.chart.axis.AxisCollection;<a name="line.276"></a>
- <span class="sourceLineNo">277</span>import org.jfree.chart.axis.AxisLocation;<a name="line.277"></a>
- <span class="sourceLineNo">278</span>import org.jfree.chart.axis.AxisSpace;<a name="line.278"></a>
- <span class="sourceLineNo">279</span>import org.jfree.chart.axis.AxisState;<a name="line.279"></a>
- <span class="sourceLineNo">280</span>import org.jfree.chart.axis.TickType;<a name="line.280"></a>
- <span class="sourceLineNo">281</span>import org.jfree.chart.axis.ValueAxis;<a name="line.281"></a>
- <span class="sourceLineNo">282</span>import org.jfree.chart.axis.ValueTick;<a name="line.282"></a>
- <span class="sourceLineNo">283</span>import org.jfree.chart.event.AnnotationChangeEvent;<a name="line.283"></a>
- <span class="sourceLineNo">284</span>import org.jfree.chart.event.ChartChangeEventType;<a name="line.284"></a>
- <span class="sourceLineNo">285</span>import org.jfree.chart.event.PlotChangeEvent;<a name="line.285"></a>
- <span class="sourceLineNo">286</span>import org.jfree.chart.event.RendererChangeEvent;<a name="line.286"></a>
- <span class="sourceLineNo">287</span>import org.jfree.chart.event.RendererChangeListener;<a name="line.287"></a>
- <span class="sourceLineNo">288</span>import org.jfree.chart.renderer.RendererUtilities;<a name="line.288"></a>
- <span class="sourceLineNo">289</span>import org.jfree.chart.renderer.xy.AbstractXYItemRenderer;<a name="line.289"></a>
- <span class="sourceLineNo">290</span>import org.jfree.chart.renderer.xy.XYItemRenderer;<a name="line.290"></a>
- <span class="sourceLineNo">291</span>import org.jfree.chart.renderer.xy.XYItemRendererState;<a name="line.291"></a>
- <span class="sourceLineNo">292</span>import org.jfree.chart.util.CloneUtils;<a name="line.292"></a>
- <span class="sourceLineNo">293</span>import org.jfree.chart.util.ParamChecks;<a name="line.293"></a>
- <span class="sourceLineNo">294</span>import org.jfree.chart.util.ResourceBundleWrapper;<a name="line.294"></a>
- <span class="sourceLineNo">295</span>import org.jfree.chart.util.ShadowGenerator;<a name="line.295"></a>
- <span class="sourceLineNo">296</span>import org.jfree.data.Range;<a name="line.296"></a>
- <span class="sourceLineNo">297</span>import org.jfree.data.general.DatasetChangeEvent;<a name="line.297"></a>
- <span class="sourceLineNo">298</span>import org.jfree.data.general.DatasetUtilities;<a name="line.298"></a>
- <span class="sourceLineNo">299</span>import org.jfree.data.xy.XYDataset;<a name="line.299"></a>
- <span class="sourceLineNo">300</span>import org.jfree.io.SerialUtilities;<a name="line.300"></a>
- <span class="sourceLineNo">301</span>import org.jfree.ui.Layer;<a name="line.301"></a>
- <span class="sourceLineNo">302</span>import org.jfree.ui.RectangleEdge;<a name="line.302"></a>
- <span class="sourceLineNo">303</span>import org.jfree.ui.RectangleInsets;<a name="line.303"></a>
- <span class="sourceLineNo">304</span>import org.jfree.util.ObjectUtilities;<a name="line.304"></a>
- <span class="sourceLineNo">305</span>import org.jfree.util.PaintUtilities;<a name="line.305"></a>
- <span class="sourceLineNo">306</span>import org.jfree.util.PublicCloneable;<a name="line.306"></a>
- <span class="sourceLineNo">307</span><a name="line.307"></a>
- <span class="sourceLineNo">308</span>/**<a name="line.308"></a>
- <span class="sourceLineNo">309</span> * A general class for plotting data in the form of (x, y) pairs. This plot can<a name="line.309"></a>
- <span class="sourceLineNo">310</span> * use data from any class that implements the {@link XYDataset} interface.<a name="line.310"></a>
- <span class="sourceLineNo">311</span> * <P><a name="line.311"></a>
- <span class="sourceLineNo">312</span> * <code>XYPlot</code> makes use of an {@link XYItemRenderer} to draw each point<a name="line.312"></a>
- <span class="sourceLineNo">313</span> * on the plot. By using different renderers, various chart types can be<a name="line.313"></a>
- <span class="sourceLineNo">314</span> * produced.<a name="line.314"></a>
- <span class="sourceLineNo">315</span> * <p><a name="line.315"></a>
- <span class="sourceLineNo">316</span> * The {@link org.jfree.chart.ChartFactory} class contains static methods for<a name="line.316"></a>
- <span class="sourceLineNo">317</span> * creating pre-configured charts.<a name="line.317"></a>
- <span class="sourceLineNo">318</span> */<a name="line.318"></a>
- <span class="sourceLineNo">319</span>public class XYPlot extends Plot implements ValueAxisPlot, Pannable, Zoomable,<a name="line.319"></a>
- <span class="sourceLineNo">320</span> RendererChangeListener, Cloneable, PublicCloneable, Serializable {<a name="line.320"></a>
- <span class="sourceLineNo">321</span><a name="line.321"></a>
- <span class="sourceLineNo">322</span> /** For serialization. */<a name="line.322"></a>
- <span class="sourceLineNo">323</span> private static final long serialVersionUID = 7044148245716569264L;<a name="line.323"></a>
- <span class="sourceLineNo">324</span><a name="line.324"></a>
- <span class="sourceLineNo">325</span> /** The default grid line stroke. */<a name="line.325"></a>
- <span class="sourceLineNo">326</span> public static final Stroke DEFAULT_GRIDLINE_STROKE = new BasicStroke(0.5f,<a name="line.326"></a>
- <span class="sourceLineNo">327</span> BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.0f,<a name="line.327"></a>
- <span class="sourceLineNo">328</span> new float[] {2.0f, 2.0f}, 0.0f);<a name="line.328"></a>
- <span class="sourceLineNo">329</span><a name="line.329"></a>
- <span class="sourceLineNo">330</span> /** The default grid line paint. */<a name="line.330"></a>
- <span class="sourceLineNo">331</span> public static final Paint DEFAULT_GRIDLINE_PAINT = Color.lightGray;<a name="line.331"></a>
- <span class="sourceLineNo">332</span><a name="line.332"></a>
- <span class="sourceLineNo">333</span> /** The default crosshair visibility. */<a name="line.333"></a>
- <span class="sourceLineNo">334</span> public static final boolean DEFAULT_CROSSHAIR_VISIBLE = false;<a name="line.334"></a>
- <span class="sourceLineNo">335</span><a name="line.335"></a>
- <span class="sourceLineNo">336</span> /** The default crosshair stroke. */<a name="line.336"></a>
- <span class="sourceLineNo">337</span> public static final Stroke DEFAULT_CROSSHAIR_STROKE<a name="line.337"></a>
- <span class="sourceLineNo">338</span> = DEFAULT_GRIDLINE_STROKE;<a name="line.338"></a>
- <span class="sourceLineNo">339</span><a name="line.339"></a>
- <span class="sourceLineNo">340</span> /** The default crosshair paint. */<a name="line.340"></a>
- <span class="sourceLineNo">341</span> public static final Paint DEFAULT_CROSSHAIR_PAINT = Color.blue;<a name="line.341"></a>
- <span class="sourceLineNo">342</span><a name="line.342"></a>
- <span class="sourceLineNo">343</span> /** The resourceBundle for the localization. */<a name="line.343"></a>
- <span class="sourceLineNo">344</span> protected static ResourceBundle localizationResources<a name="line.344"></a>
- <span class="sourceLineNo">345</span> = ResourceBundleWrapper.getBundle(<a name="line.345"></a>
- <span class="sourceLineNo">346</span> "org.jfree.chart.plot.LocalizationBundle");<a name="line.346"></a>
- <span class="sourceLineNo">347</span><a name="line.347"></a>
- <span class="sourceLineNo">348</span> /** The plot orientation. */<a name="line.348"></a>
- <span class="sourceLineNo">349</span> private PlotOrientation orientation;<a name="line.349"></a>
- <span class="sourceLineNo">350</span><a name="line.350"></a>
- <span class="sourceLineNo">351</span> /** The offset between the data area and the axes. */<a name="line.351"></a>
- <span class="sourceLineNo">352</span> private RectangleInsets axisOffset;<a name="line.352"></a>
- <span class="sourceLineNo">353</span><a name="line.353"></a>
- <span class="sourceLineNo">354</span> /** The domain axis / axes (used for the x-values). */<a name="line.354"></a>
- <span class="sourceLineNo">355</span> private Map<Integer, ValueAxis> domainAxes;<a name="line.355"></a>
- <span class="sourceLineNo">356</span><a name="line.356"></a>
- <span class="sourceLineNo">357</span> /** The domain axis locations. */<a name="line.357"></a>
- <span class="sourceLineNo">358</span> private Map<Integer, AxisLocation> domainAxisLocations;<a name="line.358"></a>
- <span class="sourceLineNo">359</span><a name="line.359"></a>
- <span class="sourceLineNo">360</span> /** The range axis (used for the y-values). */<a name="line.360"></a>
- <span class="sourceLineNo">361</span> private Map<Integer, ValueAxis> rangeAxes;<a name="line.361"></a>
- <span class="sourceLineNo">362</span><a name="line.362"></a>
- <span class="sourceLineNo">363</span> /** The range axis location. */<a name="line.363"></a>
- <span class="sourceLineNo">364</span> private Map<Integer, AxisLocation> rangeAxisLocations;<a name="line.364"></a>
- <span class="sourceLineNo">365</span><a name="line.365"></a>
- <span class="sourceLineNo">366</span> /** Storage for the datasets. */<a name="line.366"></a>
- <span class="sourceLineNo">367</span> private Map<Integer, XYDataset> datasets;<a name="line.367"></a>
- <span class="sourceLineNo">368</span><a name="line.368"></a>
- <span class="sourceLineNo">369</span> /** Storage for the renderers. */<a name="line.369"></a>
- <span class="sourceLineNo">370</span> private Map<Integer, XYItemRenderer> renderers;<a name="line.370"></a>
- <span class="sourceLineNo">371</span><a name="line.371"></a>
- <span class="sourceLineNo">372</span> /**<a name="line.372"></a>
- <span class="sourceLineNo">373</span> * Storage for the mapping between datasets/renderers and domain axes. The<a name="line.373"></a>
- <span class="sourceLineNo">374</span> * keys in the map are Integer objects, corresponding to the dataset<a name="line.374"></a>
- <span class="sourceLineNo">375</span> * index. The values in the map are List objects containing Integer<a name="line.375"></a>
- <span class="sourceLineNo">376</span> * objects (corresponding to the axis indices). If the map contains no<a name="line.376"></a>
- <span class="sourceLineNo">377</span> * entry for a dataset, it is assumed to map to the primary domain axis<a name="line.377"></a>
- <span class="sourceLineNo">378</span> * (index = 0).<a name="line.378"></a>
- <span class="sourceLineNo">379</span> */<a name="line.379"></a>
- <span class="sourceLineNo">380</span> private Map<Integer, List<Integer>> datasetToDomainAxesMap;<a name="line.380"></a>
- <span class="sourceLineNo">381</span><a name="line.381"></a>
- <span class="sourceLineNo">382</span> /**<a name="line.382"></a>
- <span class="sourceLineNo">383</span> * Storage for the mapping between datasets/renderers and range axes. The<a name="line.383"></a>
- <span class="sourceLineNo">384</span> * keys in the map are Integer objects, corresponding to the dataset<a name="line.384"></a>
- <span class="sourceLineNo">385</span> * index. The values in the map are List objects containing Integer<a name="line.385"></a>
- <span class="sourceLineNo">386</span> * objects (corresponding to the axis indices). If the map contains no<a name="line.386"></a>
- <span class="sourceLineNo">387</span> * entry for a dataset, it is assumed to map to the primary domain axis<a name="line.387"></a>
- <span class="sourceLineNo">388</span> * (index = 0).<a name="line.388"></a>
- <span class="sourceLineNo">389</span> */<a name="line.389"></a>
- <span class="sourceLineNo">390</span> private Map<Integer, List<Integer>> datasetToRangeAxesMap;<a name="line.390"></a>
- <span class="sourceLineNo">391</span><a name="line.391"></a>
- <span class="sourceLineNo">392</span> /** The origin point for the quadrants (if drawn). */<a name="line.392"></a>
- <span class="sourceLineNo">393</span> private transient Point2D quadrantOrigin = new Point2D.Double(0.0, 0.0);<a name="line.393"></a>
- <span class="sourceLineNo">394</span><a name="line.394"></a>
- <span class="sourceLineNo">395</span> /** The paint used for each quadrant. */<a name="line.395"></a>
- <span class="sourceLineNo">396</span> private transient Paint[] quadrantPaint<a name="line.396"></a>
- <span class="sourceLineNo">397</span> = new Paint[] {null, null, null, null};<a name="line.397"></a>
- <span class="sourceLineNo">398</span><a name="line.398"></a>
- <span class="sourceLineNo">399</span> /** A flag that controls whether the domain grid-lines are visible. */<a name="line.399"></a>
- <span class="sourceLineNo">400</span> private boolean domainGridlinesVisible;<a name="line.400"></a>
- <span class="sourceLineNo">401</span><a name="line.401"></a>
- <span class="sourceLineNo">402</span> /** The stroke used to draw the domain grid-lines. */<a name="line.402"></a>
- <span class="sourceLineNo">403</span> private transient Stroke domainGridlineStroke;<a name="line.403"></a>
- <span class="sourceLineNo">404</span><a name="line.404"></a>
- <span class="sourceLineNo">405</span> /** The paint used to draw the domain grid-lines. */<a name="line.405"></a>
- <span class="sourceLineNo">406</span> private transient Paint domainGridlinePaint;<a name="line.406"></a>
- <span class="sourceLineNo">407</span><a name="line.407"></a>
- <span class="sourceLineNo">408</span> /** A flag that controls whether the range grid-lines are visible. */<a name="line.408"></a>
- <span class="sourceLineNo">409</span> private boolean rangeGridlinesVisible;<a name="line.409"></a>
- <span class="sourceLineNo">410</span><a name="line.410"></a>
- <span class="sourceLineNo">411</span> /** The stroke used to draw the range grid-lines. */<a name="line.411"></a>
- <span class="sourceLineNo">412</span> private transient Stroke rangeGridlineStroke;<a name="line.412"></a>
- <span class="sourceLineNo">413</span><a name="line.413"></a>
- <span class="sourceLineNo">414</span> /** The paint used to draw the range grid-lines. */<a name="line.414"></a>
- <span class="sourceLineNo">415</span> private transient Paint rangeGridlinePaint;<a name="line.415"></a>
- <span class="sourceLineNo">416</span><a name="line.416"></a>
- <span class="sourceLineNo">417</span> /**<a name="line.417"></a>
- <span class="sourceLineNo">418</span> * A flag that controls whether the domain minor grid-lines are visible.<a name="line.418"></a>
- <span class="sourceLineNo">419</span> *<a name="line.419"></a>
- <span class="sourceLineNo">420</span> * @since 1.0.12<a name="line.420"></a>
- <span class="sourceLineNo">421</span> */<a name="line.421"></a>
- <span class="sourceLineNo">422</span> private boolean domainMinorGridlinesVisible;<a name="line.422"></a>
- <span class="sourceLineNo">423</span><a name="line.423"></a>
- <span class="sourceLineNo">424</span> /**<a name="line.424"></a>
- <span class="sourceLineNo">425</span> * The stroke used to draw the domain minor grid-lines.<a name="line.425"></a>
- <span class="sourceLineNo">426</span> *<a name="line.426"></a>
- <span class="sourceLineNo">427</span> * @since 1.0.12<a name="line.427"></a>
- <span class="sourceLineNo">428</span> */<a name="line.428"></a>
- <span class="sourceLineNo">429</span> private transient Stroke domainMinorGridlineStroke;<a name="line.429"></a>
- <span class="sourceLineNo">430</span><a name="line.430"></a>
- <span class="sourceLineNo">431</span> /**<a name="line.431"></a>
- <span class="sourceLineNo">432</span> * The paint used to draw the domain minor grid-lines.<a name="line.432"></a>
- <span class="sourceLineNo">433</span> *<a name="line.433"></a>
- <span class="sourceLineNo">434</span> * @since 1.0.12<a name="line.434"></a>
- <span class="sourceLineNo">435</span> */<a name="line.435"></a>
- <span class="sourceLineNo">436</span> private transient Paint domainMinorGridlinePaint;<a name="line.436"></a>
- <span class="sourceLineNo">437</span><a name="line.437"></a>
- <span class="sourceLineNo">438</span> /**<a name="line.438"></a>
- <span class="sourceLineNo">439</span> * A flag that controls whether the range minor grid-lines are visible.<a name="line.439"></a>
- <span class="sourceLineNo">440</span> *<a name="line.440"></a>
- <span class="sourceLineNo">441</span> * @since 1.0.12<a name="line.441"></a>
- <span class="sourceLineNo">442</span> */<a name="line.442"></a>
- <span class="sourceLineNo">443</span> private boolean rangeMinorGridlinesVisible;<a name="line.443"></a>
- <span class="sourceLineNo">444</span><a name="line.444"></a>
- <span class="sourceLineNo">445</span> /**<a name="line.445"></a>
- <span class="sourceLineNo">446</span> * The stroke used to draw the range minor grid-lines.<a name="line.446"></a>
- <span class="sourceLineNo">447</span> *<a name="line.447"></a>
- <span class="sourceLineNo">448</span> * @since 1.0.12<a name="line.448"></a>
- <span class="sourceLineNo">449</span> */<a name="line.449"></a>
- <span class="sourceLineNo">450</span> private transient Stroke rangeMinorGridlineStroke;<a name="line.450"></a>
- <span class="sourceLineNo">451</span><a name="line.451"></a>
- <span class="sourceLineNo">452</span> /**<a name="line.452"></a>
- <span class="sourceLineNo">453</span> * The paint used to draw the range minor grid-lines.<a name="line.453"></a>
- <span class="sourceLineNo">454</span> *<a name="line.454"></a>
- <span class="sourceLineNo">455</span> * @since 1.0.12<a name="line.455"></a>
- <span class="sourceLineNo">456</span> */<a name="line.456"></a>
- <span class="sourceLineNo">457</span> private transient Paint rangeMinorGridlinePaint;<a name="line.457"></a>
- <span class="sourceLineNo">458</span><a name="line.458"></a>
- <span class="sourceLineNo">459</span> /**<a name="line.459"></a>
- <span class="sourceLineNo">460</span> * A flag that controls whether or not the zero baseline against the domain<a name="line.460"></a>
- <span class="sourceLineNo">461</span> * axis is visible.<a name="line.461"></a>
- <span class="sourceLineNo">462</span> *<a name="line.462"></a>
- <span class="sourceLineNo">463</span> * @since 1.0.5<a name="line.463"></a>
- <span class="sourceLineNo">464</span> */<a name="line.464"></a>
- <span class="sourceLineNo">465</span> private boolean domainZeroBaselineVisible;<a name="line.465"></a>
- <span class="sourceLineNo">466</span><a name="line.466"></a>
- <span class="sourceLineNo">467</span> /**<a name="line.467"></a>
- <span class="sourceLineNo">468</span> * The stroke used for the zero baseline against the domain axis.<a name="line.468"></a>
- <span class="sourceLineNo">469</span> *<a name="line.469"></a>
- <span class="sourceLineNo">470</span> * @since 1.0.5<a name="line.470"></a>
- <span class="sourceLineNo">471</span> */<a name="line.471"></a>
- <span class="sourceLineNo">472</span> private transient Stroke domainZeroBaselineStroke;<a name="line.472"></a>
- <span class="sourceLineNo">473</span><a name="line.473"></a>
- <span class="sourceLineNo">474</span> /**<a name="line.474"></a>
- <span class="sourceLineNo">475</span> * The paint used for the zero baseline against the domain axis.<a name="line.475"></a>
- <span class="sourceLineNo">476</span> *<a name="line.476"></a>
- <span class="sourceLineNo">477</span> * @since 1.0.5<a name="line.477"></a>
- <span class="sourceLineNo">478</span> */<a name="line.478"></a>
- <span class="sourceLineNo">479</span> private transient Paint domainZeroBaselinePaint;<a name="line.479"></a>
- <span class="sourceLineNo">480</span><a name="line.480"></a>
- <span class="sourceLineNo">481</span> /**<a name="line.481"></a>
- <span class="sourceLineNo">482</span> * A flag that controls whether or not the zero baseline against the range<a name="line.482"></a>
- <span class="sourceLineNo">483</span> * axis is visible.<a name="line.483"></a>
- <span class="sourceLineNo">484</span> */<a name="line.484"></a>
- <span class="sourceLineNo">485</span> private boolean rangeZeroBaselineVisible;<a name="line.485"></a>
- <span class="sourceLineNo">486</span><a name="line.486"></a>
- <span class="sourceLineNo">487</span> /** The stroke used for the zero baseline against the range axis. */<a name="line.487"></a>
- <span class="sourceLineNo">488</span> private transient Stroke rangeZeroBaselineStroke;<a name="line.488"></a>
- <span class="sourceLineNo">489</span><a name="line.489"></a>
- <span class="sourceLineNo">490</span> /** The paint used for the zero baseline against the range axis. */<a name="line.490"></a>
- <span class="sourceLineNo">491</span> private transient Paint rangeZeroBaselinePaint;<a name="line.491"></a>
- <span class="sourceLineNo">492</span><a name="line.492"></a>
- <span class="sourceLineNo">493</span> /** A flag that controls whether or not a domain crosshair is drawn..*/<a name="line.493"></a>
- <span class="sourceLineNo">494</span> private boolean domainCrosshairVisible;<a name="line.494"></a>
- <span class="sourceLineNo">495</span><a name="line.495"></a>
- <span class="sourceLineNo">496</span> /** The domain crosshair value. */<a name="line.496"></a>
- <span class="sourceLineNo">497</span> private double domainCrosshairValue;<a name="line.497"></a>
- <span class="sourceLineNo">498</span><a name="line.498"></a>
- <span class="sourceLineNo">499</span> /** The pen/brush used to draw the crosshair (if any). */<a name="line.499"></a>
- <span class="sourceLineNo">500</span> private transient Stroke domainCrosshairStroke;<a name="line.500"></a>
- <span class="sourceLineNo">501</span><a name="line.501"></a>
- <span class="sourceLineNo">502</span> /** The color used to draw the crosshair (if any). */<a name="line.502"></a>
- <span class="sourceLineNo">503</span> private transient Paint domainCrosshairPaint;<a name="line.503"></a>
- <span class="sourceLineNo">504</span><a name="line.504"></a>
- <span class="sourceLineNo">505</span> /**<a name="line.505"></a>
- <span class="sourceLineNo">506</span> * A flag that controls whether or not the crosshair locks onto actual<a name="line.506"></a>
- <span class="sourceLineNo">507</span> * data points.<a name="line.507"></a>
- <span class="sourceLineNo">508</span> */<a name="line.508"></a>
- <span class="sourceLineNo">509</span> private boolean domainCrosshairLockedOnData = true;<a name="line.509"></a>
- <span class="sourceLineNo">510</span><a name="line.510"></a>
- <span class="sourceLineNo">511</span> /** A flag that controls whether or not a range crosshair is drawn..*/<a name="line.511"></a>
- <span class="sourceLineNo">512</span> private boolean rangeCrosshairVisible;<a name="line.512"></a>
- <span class="sourceLineNo">513</span><a name="line.513"></a>
- <span class="sourceLineNo">514</span> /** The range crosshair value. */<a name="line.514"></a>
- <span class="sourceLineNo">515</span> private double rangeCrosshairValue;<a name="line.515"></a>
- <span class="sourceLineNo">516</span><a name="line.516"></a>
- <span class="sourceLineNo">517</span> /** The pen/brush used to draw the crosshair (if any). */<a name="line.517"></a>
- <span class="sourceLineNo">518</span> private transient Stroke rangeCrosshairStroke;<a name="line.518"></a>
- <span class="sourceLineNo">519</span><a name="line.519"></a>
- <span class="sourceLineNo">520</span> /** The color used to draw the crosshair (if any). */<a name="line.520"></a>
- <span class="sourceLineNo">521</span> private transient Paint rangeCrosshairPaint;<a name="line.521"></a>
- <span class="sourceLineNo">522</span><a name="line.522"></a>
- <span class="sourceLineNo">523</span> /**<a name="line.523"></a>
- <span class="sourceLineNo">524</span> * A flag that controls whether or not the crosshair locks onto actual<a name="line.524"></a>
- <span class="sourceLineNo">525</span> * data points.<a name="line.525"></a>
- <span class="sourceLineNo">526</span> */<a name="line.526"></a>
- <span class="sourceLineNo">527</span> private boolean rangeCrosshairLockedOnData = true;<a name="line.527"></a>
- <span class="sourceLineNo">528</span><a name="line.528"></a>
- <span class="sourceLineNo">529</span> /** A map of lists of foreground markers (optional) for the domain axes. */<a name="line.529"></a>
- <span class="sourceLineNo">530</span> private Map foregroundDomainMarkers;<a name="line.530"></a>
- <span class="sourceLineNo">531</span><a name="line.531"></a>
- <span class="sourceLineNo">532</span> /** A map of lists of background markers (optional) for the domain axes. */<a name="line.532"></a>
- <span class="sourceLineNo">533</span> private Map backgroundDomainMarkers;<a name="line.533"></a>
- <span class="sourceLineNo">534</span><a name="line.534"></a>
- <span class="sourceLineNo">535</span> /** A map of lists of foreground markers (optional) for the range axes. */<a name="line.535"></a>
- <span class="sourceLineNo">536</span> private Map foregroundRangeMarkers;<a name="line.536"></a>
- <span class="sourceLineNo">537</span><a name="line.537"></a>
- <span class="sourceLineNo">538</span> /** A map of lists of background markers (optional) for the range axes. */<a name="line.538"></a>
- <span class="sourceLineNo">539</span> private Map backgroundRangeMarkers;<a name="line.539"></a>
- <span class="sourceLineNo">540</span><a name="line.540"></a>
- <span class="sourceLineNo">541</span> /**<a name="line.541"></a>
- <span class="sourceLineNo">542</span> * A (possibly empty) list of annotations for the plot. The list should<a name="line.542"></a>
- <span class="sourceLineNo">543</span> * be initialised in the constructor and never allowed to be<a name="line.543"></a>
- <span class="sourceLineNo">544</span> * <code>null</code>.<a name="line.544"></a>
- <span class="sourceLineNo">545</span> */<a name="line.545"></a>
- <span class="sourceLineNo">546</span> private List<XYAnnotation> annotations;<a name="line.546"></a>
- <span class="sourceLineNo">547</span><a name="line.547"></a>
- <span class="sourceLineNo">548</span> /** The paint used for the domain tick bands (if any). */<a name="line.548"></a>
- <span class="sourceLineNo">549</span> private transient Paint domainTickBandPaint;<a name="line.549"></a>
- <span class="sourceLineNo">550</span><a name="line.550"></a>
- <span class="sourceLineNo">551</span> /** The paint used for the range tick bands (if any). */<a name="line.551"></a>
- <span class="sourceLineNo">552</span> private transient Paint rangeTickBandPaint;<a name="line.552"></a>
- <span class="sourceLineNo">553</span><a name="line.553"></a>
- <span class="sourceLineNo">554</span> /** The fixed domain axis space. */<a name="line.554"></a>
- <span class="sourceLineNo">555</span> private AxisSpace fixedDomainAxisSpace;<a name="line.555"></a>
- <span class="sourceLineNo">556</span><a name="line.556"></a>
- <span class="sourceLineNo">557</span> /** The fixed range axis space. */<a name="line.557"></a>
- <span class="sourceLineNo">558</span> private AxisSpace fixedRangeAxisSpace;<a name="line.558"></a>
- <span class="sourceLineNo">559</span><a name="line.559"></a>
- <span class="sourceLineNo">560</span> /**<a name="line.560"></a>
- <span class="sourceLineNo">561</span> * The order of the dataset rendering (REVERSE draws the primary dataset<a name="line.561"></a>
- <span class="sourceLineNo">562</span> * last so that it appears to be on top).<a name="line.562"></a>
- <span class="sourceLineNo">563</span> */<a name="line.563"></a>
- <span class="sourceLineNo">564</span> private DatasetRenderingOrder datasetRenderingOrder<a name="line.564"></a>
- <span class="sourceLineNo">565</span> = DatasetRenderingOrder.REVERSE;<a name="line.565"></a>
- <span class="sourceLineNo">566</span><a name="line.566"></a>
- <span class="sourceLineNo">567</span> /**<a name="line.567"></a>
- <span class="sourceLineNo">568</span> * The order of the series rendering (REVERSE draws the primary series<a name="line.568"></a>
- <span class="sourceLineNo">569</span> * last so that it appears to be on top).<a name="line.569"></a>
- <span class="sourceLineNo">570</span> */<a name="line.570"></a>
- <span class="sourceLineNo">571</span> private SeriesRenderingOrder seriesRenderingOrder<a name="line.571"></a>
- <span class="sourceLineNo">572</span> = SeriesRenderingOrder.REVERSE;<a name="line.572"></a>
- <span class="sourceLineNo">573</span><a name="line.573"></a>
- <span class="sourceLineNo">574</span> /**<a name="line.574"></a>
- <span class="sourceLineNo">575</span> * The weight for this plot (only relevant if this is a subplot in a<a name="line.575"></a>
- <span class="sourceLineNo">576</span> * combined plot).<a name="line.576"></a>
- <span class="sourceLineNo">577</span> */<a name="line.577"></a>
- <span class="sourceLineNo">578</span> private int weight;<a name="line.578"></a>
- <span class="sourceLineNo">579</span><a name="line.579"></a>
- <span class="sourceLineNo">580</span> /**<a name="line.580"></a>
- <span class="sourceLineNo">581</span> * An optional collection of legend items that can be returned by the<a name="line.581"></a>
- <span class="sourceLineNo">582</span> * getLegendItems() method.<a name="line.582"></a>
- <span class="sourceLineNo">583</span> */<a name="line.583"></a>
- <span class="sourceLineNo">584</span> private LegendItemCollection fixedLegendItems;<a name="line.584"></a>
- <span class="sourceLineNo">585</span><a name="line.585"></a>
- <span class="sourceLineNo">586</span> /**<a name="line.586"></a>
- <span class="sourceLineNo">587</span> * A flag that controls whether or not panning is enabled for the domain<a name="line.587"></a>
- <span class="sourceLineNo">588</span> * axis/axes.<a name="line.588"></a>
- <span class="sourceLineNo">589</span> *<a name="line.589"></a>
- <span class="sourceLineNo">590</span> * @since 1.0.13<a name="line.590"></a>
- <span class="sourceLineNo">591</span> */<a name="line.591"></a>
- <span class="sourceLineNo">592</span> private boolean domainPannable;<a name="line.592"></a>
- <span class="sourceLineNo">593</span><a name="line.593"></a>
- <span class="sourceLineNo">594</span> /**<a name="line.594"></a>
- <span class="sourceLineNo">595</span> * A flag that controls whether or not panning is enabled for the range<a name="line.595"></a>
- <span class="sourceLineNo">596</span> * axis/axes.<a name="line.596"></a>
- <span class="sourceLineNo">597</span> *<a name="line.597"></a>
- <span class="sourceLineNo">598</span> * @since 1.0.13<a name="line.598"></a>
- <span class="sourceLineNo">599</span> */<a name="line.599"></a>
- <span class="sourceLineNo">600</span> private boolean rangePannable;<a name="line.600"></a>
- <span class="sourceLineNo">601</span><a name="line.601"></a>
- <span class="sourceLineNo">602</span> /**<a name="line.602"></a>
- <span class="sourceLineNo">603</span> * The shadow generator (<code>null</code> permitted).<a name="line.603"></a>
- <span class="sourceLineNo">604</span> *<a name="line.604"></a>
- <span class="sourceLineNo">605</span> * @since 1.0.14<a name="line.605"></a>
- <span class="sourceLineNo">606</span> */<a name="line.606"></a>
- <span class="sourceLineNo">607</span> private ShadowGenerator shadowGenerator;<a name="line.607"></a>
- <span class="sourceLineNo">608</span><a name="line.608"></a>
- <span class="sourceLineNo">609</span> /**<a name="line.609"></a>
- <span class="sourceLineNo">610</span> * Creates a new <code>XYPlot</code> instance with no dataset, no axes and<a name="line.610"></a>
- <span class="sourceLineNo">611</span> * no renderer. You should specify these items before using the plot.<a name="line.611"></a>
- <span class="sourceLineNo">612</span> */<a name="line.612"></a>
- <span class="sourceLineNo">613</span> public XYPlot() {<a name="line.613"></a>
- <span class="sourceLineNo">614</span> this(null, null, null, null);<a name="line.614"></a>
- <span class="sourceLineNo">615</span> }<a name="line.615"></a>
- <span class="sourceLineNo">616</span><a name="line.616"></a>
- <span class="sourceLineNo">617</span> /**<a name="line.617"></a>
- <span class="sourceLineNo">618</span> * Creates a new plot with the specified dataset, axes and renderer. Any<a name="line.618"></a>
- <span class="sourceLineNo">619</span> * of the arguments can be <code>null</code>, but in that case you should<a name="line.619"></a>
- <span class="sourceLineNo">620</span> * take care to specify the value before using the plot (otherwise a<a name="line.620"></a>
- <span class="sourceLineNo">621</span> * <code>NullPointerException</code> may be thrown).<a name="line.621"></a>
- <span class="sourceLineNo">622</span> *<a name="line.622"></a>
- <span class="sourceLineNo">623</span> * @param dataset the dataset (<code>null</code> permitted).<a name="line.623"></a>
- <span class="sourceLineNo">624</span> * @param domainAxis the domain axis (<code>null</code> permitted).<a name="line.624"></a>
- <span class="sourceLineNo">625</span> * @param rangeAxis the range axis (<code>null</code> permitted).<a name="line.625"></a>
- <span class="sourceLineNo">626</span> * @param renderer the renderer (<code>null</code> permitted).<a name="line.626"></a>
- <span class="sourceLineNo">627</span> */<a name="line.627"></a>
- <span class="sourceLineNo">628</span> public XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis,<a name="line.628"></a>
- <span class="sourceLineNo">629</span> XYItemRenderer renderer) {<a name="line.629"></a>
- <span class="sourceLineNo">630</span> super();<a name="line.630"></a>
- <span class="sourceLineNo">631</span> this.orientation = PlotOrientation.VERTICAL;<a name="line.631"></a>
- <span class="sourceLineNo">632</span> this.weight = 1; // only relevant when this is a subplot<a name="line.632"></a>
- <span class="sourceLineNo">633</span> this.axisOffset = RectangleInsets.ZERO_INSETS;<a name="line.633"></a>
- <span class="sourceLineNo">634</span><a name="line.634"></a>
- <span class="sourceLineNo">635</span> // allocate storage for datasets, axes and renderers (all optional)<a name="line.635"></a>
- <span class="sourceLineNo">636</span> this.domainAxes = new HashMap<Integer, ValueAxis>();<a name="line.636"></a>
- <span class="sourceLineNo">637</span> this.domainAxisLocations = new HashMap<Integer, AxisLocation>();<a name="line.637"></a>
- <span class="sourceLineNo">638</span> this.foregroundDomainMarkers = new HashMap();<a name="line.638"></a>
- <span class="sourceLineNo">639</span> this.backgroundDomainMarkers = new HashMap();<a name="line.639"></a>
- <span class="sourceLineNo">640</span><a name="line.640"></a>
- <span class="sourceLineNo">641</span> this.rangeAxes = new HashMap<Integer, ValueAxis>();<a name="line.641"></a>
- <span class="sourceLineNo">642</span> this.rangeAxisLocations = new HashMap<Integer, AxisLocation>();<a name="line.642"></a>
- <span class="sourceLineNo">643</span> this.foregroundRangeMarkers = new HashMap();<a name="line.643"></a>
- <span class="sourceLineNo">644</span> this.backgroundRangeMarkers = new HashMap();<a name="line.644"></a>
- <span class="sourceLineNo">645</span><a name="line.645"></a>
- <span class="sourceLineNo">646</span> this.datasets = new HashMap<Integer, XYDataset>();<a name="line.646"></a>
- <span class="sourceLineNo">647</span> this.renderers = new HashMap<Integer, XYItemRenderer>();<a name="line.647"></a>
- <span class="sourceLineNo">648</span><a name="line.648"></a>
- <span class="sourceLineNo">649</span> this.datasetToDomainAxesMap = new TreeMap();<a name="line.649"></a>
- <span class="sourceLineNo">650</span> this.datasetToRangeAxesMap = new TreeMap();<a name="line.650"></a>
- <span class="sourceLineNo">651</span><a name="line.651"></a>
- <span class="sourceLineNo">652</span> this.annotations = new java.util.ArrayList();<a name="line.652"></a>
- <span class="sourceLineNo">653</span><a name="line.653"></a>
- <span class="sourceLineNo">654</span> this.datasets.put(0, dataset);<a name="line.654"></a>
- <span class="sourceLineNo">655</span> if (dataset != null) {<a name="line.655"></a>
- <span class="sourceLineNo">656</span> dataset.addChangeListener(this);<a name="line.656"></a>
- <span class="sourceLineNo">657</span> }<a name="line.657"></a>
- <span class="sourceLineNo">658</span><a name="line.658"></a>
- <span class="sourceLineNo">659</span> this.renderers.put(0, renderer);<a name="line.659"></a>
- <span class="sourceLineNo">660</span> if (renderer != null) {<a name="line.660"></a>
- <span class="sourceLineNo">661</span> renderer.setPlot(this);<a name="line.661"></a>
- <span class="sourceLineNo">662</span> renderer.addChangeListener(this);<a name="line.662"></a>
- <span class="sourceLineNo">663</span> }<a name="line.663"></a>
- <span class="sourceLineNo">664</span><a name="line.664"></a>
- <span class="sourceLineNo">665</span> this.domainAxes.put(0, domainAxis);<a name="line.665"></a>
- <span class="sourceLineNo">666</span> mapDatasetToDomainAxis(0, 0);<a name="line.666"></a>
- <span class="sourceLineNo">667</span> if (domainAxis != null) {<a name="line.667"></a>
- <span class="sourceLineNo">668</span> domainAxis.setPlot(this);<a name="line.668"></a>
- <span class="sourceLineNo">669</span> domainAxis.addChangeListener(this);<a name="line.669"></a>
- <span class="sourceLineNo">670</span> }<a name="line.670"></a>
- <span class="sourceLineNo">671</span> this.domainAxisLocations.put(0, AxisLocation.BOTTOM_OR_LEFT);<a name="line.671"></a>
- <span class="sourceLineNo">672</span><a name="line.672"></a>
- <span class="sourceLineNo">673</span> this.rangeAxes.put(0, rangeAxis);<a name="line.673"></a>
- <span class="sourceLineNo">674</span> mapDatasetToRangeAxis(0, 0);<a name="line.674"></a>
- <span class="sourceLineNo">675</span> if (rangeAxis != null) {<a name="line.675"></a>
- <span class="sourceLineNo">676</span> rangeAxis.setPlot(this);<a name="line.676"></a>
- <span class="sourceLineNo">677</span> rangeAxis.addChangeListener(this);<a name="line.677"></a>
- <span class="sourceLineNo">678</span> }<a name="line.678"></a>
- <span class="sourceLineNo">679</span> this.rangeAxisLocations.put(0, AxisLocation.BOTTOM_OR_LEFT);<a name="line.679"></a>
- <span class="sourceLineNo">680</span><a name="line.680"></a>
- <span class="sourceLineNo">681</span> configureDomainAxes();<a name="line.681"></a>
- <span class="sourceLineNo">682</span> configureRangeAxes();<a name="line.682"></a>
- <span class="sourceLineNo">683</span><a name="line.683"></a>
- <span class="sourceLineNo">684</span> this.domainGridlinesVisible = true;<a name="line.684"></a>
- <span class="sourceLineNo">685</span> this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.685"></a>
- <span class="sourceLineNo">686</span> this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;<a name="line.686"></a>
- <span class="sourceLineNo">687</span><a name="line.687"></a>
- <span class="sourceLineNo">688</span> this.domainMinorGridlinesVisible = false;<a name="line.688"></a>
- <span class="sourceLineNo">689</span> this.domainMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.689"></a>
- <span class="sourceLineNo">690</span> this.domainMinorGridlinePaint = Color.white;<a name="line.690"></a>
- <span class="sourceLineNo">691</span><a name="line.691"></a>
- <span class="sourceLineNo">692</span> this.domainZeroBaselineVisible = false;<a name="line.692"></a>
- <span class="sourceLineNo">693</span> this.domainZeroBaselinePaint = Color.black;<a name="line.693"></a>
- <span class="sourceLineNo">694</span> this.domainZeroBaselineStroke = new BasicStroke(0.5f);<a name="line.694"></a>
- <span class="sourceLineNo">695</span><a name="line.695"></a>
- <span class="sourceLineNo">696</span> this.rangeGridlinesVisible = true;<a name="line.696"></a>
- <span class="sourceLineNo">697</span> this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.697"></a>
- <span class="sourceLineNo">698</span> this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;<a name="line.698"></a>
- <span class="sourceLineNo">699</span><a name="line.699"></a>
- <span class="sourceLineNo">700</span> this.rangeMinorGridlinesVisible = false;<a name="line.700"></a>
- <span class="sourceLineNo">701</span> this.rangeMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.701"></a>
- <span class="sourceLineNo">702</span> this.rangeMinorGridlinePaint = Color.white;<a name="line.702"></a>
- <span class="sourceLineNo">703</span><a name="line.703"></a>
- <span class="sourceLineNo">704</span> this.rangeZeroBaselineVisible = false;<a name="line.704"></a>
- <span class="sourceLineNo">705</span> this.rangeZeroBaselinePaint = Color.black;<a name="line.705"></a>
- <span class="sourceLineNo">706</span> this.rangeZeroBaselineStroke = new BasicStroke(0.5f);<a name="line.706"></a>
- <span class="sourceLineNo">707</span><a name="line.707"></a>
- <span class="sourceLineNo">708</span> this.domainCrosshairVisible = false;<a name="line.708"></a>
- <span class="sourceLineNo">709</span> this.domainCrosshairValue = 0.0;<a name="line.709"></a>
- <span class="sourceLineNo">710</span> this.domainCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;<a name="line.710"></a>
- <span class="sourceLineNo">711</span> this.domainCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;<a name="line.711"></a>
- <span class="sourceLineNo">712</span><a name="line.712"></a>
- <span class="sourceLineNo">713</span> this.rangeCrosshairVisible = false;<a name="line.713"></a>
- <span class="sourceLineNo">714</span> this.rangeCrosshairValue = 0.0;<a name="line.714"></a>
- <span class="sourceLineNo">715</span> this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;<a name="line.715"></a>
- <span class="sourceLineNo">716</span> this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;<a name="line.716"></a>
- <span class="sourceLineNo">717</span> this.shadowGenerator = null;<a name="line.717"></a>
- <span class="sourceLineNo">718</span> }<a name="line.718"></a>
- <span class="sourceLineNo">719</span><a name="line.719"></a>
- <span class="sourceLineNo">720</span> /**<a name="line.720"></a>
- <span class="sourceLineNo">721</span> * Returns the plot type as a string.<a name="line.721"></a>
- <span class="sourceLineNo">722</span> *<a name="line.722"></a>
- <span class="sourceLineNo">723</span> * @return A short string describing the type of plot.<a name="line.723"></a>
- <span class="sourceLineNo">724</span> */<a name="line.724"></a>
- <span class="sourceLineNo">725</span> @Override<a name="line.725"></a>
- <span class="sourceLineNo">726</span> public String getPlotType() {<a name="line.726"></a>
- <span class="sourceLineNo">727</span> return localizationResources.getString("XY_Plot");<a name="line.727"></a>
- <span class="sourceLineNo">728</span> }<a name="line.728"></a>
- <span class="sourceLineNo">729</span><a name="line.729"></a>
- <span class="sourceLineNo">730</span> /**<a name="line.730"></a>
- <span class="sourceLineNo">731</span> * Returns the orientation of the plot.<a name="line.731"></a>
- <span class="sourceLineNo">732</span> *<a name="line.732"></a>
- <span class="sourceLineNo">733</span> * @return The orientation (never <code>null</code>).<a name="line.733"></a>
- <span class="sourceLineNo">734</span> *<a name="line.734"></a>
- <span class="sourceLineNo">735</span> * @see #setOrientation(PlotOrientation)<a name="line.735"></a>
- <span class="sourceLineNo">736</span> */<a name="line.736"></a>
- <span class="sourceLineNo">737</span> @Override<a name="line.737"></a>
- <span class="sourceLineNo">738</span> public PlotOrientation getOrientation() {<a name="line.738"></a>
- <span class="sourceLineNo">739</span> return this.orientation;<a name="line.739"></a>
- <span class="sourceLineNo">740</span> }<a name="line.740"></a>
- <span class="sourceLineNo">741</span><a name="line.741"></a>
- <span class="sourceLineNo">742</span> /**<a name="line.742"></a>
- <span class="sourceLineNo">743</span> * Sets the orientation for the plot and sends a {@link PlotChangeEvent} to<a name="line.743"></a>
- <span class="sourceLineNo">744</span> * all registered listeners.<a name="line.744"></a>
- <span class="sourceLineNo">745</span> *<a name="line.745"></a>
- <span class="sourceLineNo">746</span> * @param orientation the orientation (<code>null</code> not allowed).<a name="line.746"></a>
- <span class="sourceLineNo">747</span> *<a name="line.747"></a>
- <span class="sourceLineNo">748</span> * @see #getOrientation()<a name="line.748"></a>
- <span class="sourceLineNo">749</span> */<a name="line.749"></a>
- <span class="sourceLineNo">750</span> public void setOrientation(PlotOrientation orientation) {<a name="line.750"></a>
- <span class="sourceLineNo">751</span> ParamChecks.nullNotPermitted(orientation, "orientation");<a name="line.751"></a>
- <span class="sourceLineNo">752</span> if (orientation != this.orientation) {<a name="line.752"></a>
- <span class="sourceLineNo">753</span> this.orientation = orientation;<a name="line.753"></a>
- <span class="sourceLineNo">754</span> fireChangeEvent();<a name="line.754"></a>
- <span class="sourceLineNo">755</span> }<a name="line.755"></a>
- <span class="sourceLineNo">756</span> }<a name="line.756"></a>
- <span class="sourceLineNo">757</span><a name="line.757"></a>
- <span class="sourceLineNo">758</span> /**<a name="line.758"></a>
- <span class="sourceLineNo">759</span> * Returns the axis offset.<a name="line.759"></a>
- <span class="sourceLineNo">760</span> *<a name="line.760"></a>
- <span class="sourceLineNo">761</span> * @return The axis offset (never <code>null</code>).<a name="line.761"></a>
- <span class="sourceLineNo">762</span> *<a name="line.762"></a>
- <span class="sourceLineNo">763</span> * @see #setAxisOffset(RectangleInsets)<a name="line.763"></a>
- <span class="sourceLineNo">764</span> */<a name="line.764"></a>
- <span class="sourceLineNo">765</span> public RectangleInsets getAxisOffset() {<a name="line.765"></a>
- <span class="sourceLineNo">766</span> return this.axisOffset;<a name="line.766"></a>
- <span class="sourceLineNo">767</span> }<a name="line.767"></a>
- <span class="sourceLineNo">768</span><a name="line.768"></a>
- <span class="sourceLineNo">769</span> /**<a name="line.769"></a>
- <span class="sourceLineNo">770</span> * Sets the axis offsets (gap between the data area and the axes) and sends<a name="line.770"></a>
- <span class="sourceLineNo">771</span> * a {@link PlotChangeEvent} to all registered listeners.<a name="line.771"></a>
- <span class="sourceLineNo">772</span> *<a name="line.772"></a>
- <span class="sourceLineNo">773</span> * @param offset the offset (<code>null</code> not permitted).<a name="line.773"></a>
- <span class="sourceLineNo">774</span> *<a name="line.774"></a>
- <span class="sourceLineNo">775</span> * @see #getAxisOffset()<a name="line.775"></a>
- <span class="sourceLineNo">776</span> */<a name="line.776"></a>
- <span class="sourceLineNo">777</span> public void setAxisOffset(RectangleInsets offset) {<a name="line.777"></a>
- <span class="sourceLineNo">778</span> ParamChecks.nullNotPermitted(offset, "offset");<a name="line.778"></a>
- <span class="sourceLineNo">779</span> this.axisOffset = offset;<a name="line.779"></a>
- <span class="sourceLineNo">780</span> fireChangeEvent();<a name="line.780"></a>
- <span class="sourceLineNo">781</span> }<a name="line.781"></a>
- <span class="sourceLineNo">782</span><a name="line.782"></a>
- <span class="sourceLineNo">783</span> /**<a name="line.783"></a>
- <span class="sourceLineNo">784</span> * Returns the domain axis with index 0. If the domain axis for this plot<a name="line.784"></a>
- <span class="sourceLineNo">785</span> * is <code>null</code>, then the method will return the parent plot's<a name="line.785"></a>
- <span class="sourceLineNo">786</span> * domain axis (if there is a parent plot).<a name="line.786"></a>
- <span class="sourceLineNo">787</span> *<a name="line.787"></a>
- <span class="sourceLineNo">788</span> * @return The domain axis (possibly <code>null</code>).<a name="line.788"></a>
- <span class="sourceLineNo">789</span> *<a name="line.789"></a>
- <span class="sourceLineNo">790</span> * @see #getDomainAxis(int)<a name="line.790"></a>
- <span class="sourceLineNo">791</span> * @see #setDomainAxis(ValueAxis)<a name="line.791"></a>
- <span class="sourceLineNo">792</span> */<a name="line.792"></a>
- <span class="sourceLineNo">793</span> public ValueAxis getDomainAxis() {<a name="line.793"></a>
- <span class="sourceLineNo">794</span> return getDomainAxis(0);<a name="line.794"></a>
- <span class="sourceLineNo">795</span> }<a name="line.795"></a>
- <span class="sourceLineNo">796</span><a name="line.796"></a>
- <span class="sourceLineNo">797</span> /**<a name="line.797"></a>
- <span class="sourceLineNo">798</span> * Returns the domain axis with the specified index, or {@code null} if <a name="line.798"></a>
- <span class="sourceLineNo">799</span> * there is no axis with that index.<a name="line.799"></a>
- <span class="sourceLineNo">800</span> *<a name="line.800"></a>
- <span class="sourceLineNo">801</span> * @param index the axis index.<a name="line.801"></a>
- <span class="sourceLineNo">802</span> *<a name="line.802"></a>
- <span class="sourceLineNo">803</span> * @return The axis ({@code null} possible).<a name="line.803"></a>
- <span class="sourceLineNo">804</span> *<a name="line.804"></a>
- <span class="sourceLineNo">805</span> * @see #setDomainAxis(int, ValueAxis)<a name="line.805"></a>
- <span class="sourceLineNo">806</span> */<a name="line.806"></a>
- <span class="sourceLineNo">807</span> public ValueAxis getDomainAxis(int index) {<a name="line.807"></a>
- <span class="sourceLineNo">808</span> ValueAxis result = this.domainAxes.get(index);<a name="line.808"></a>
- <span class="sourceLineNo">809</span> if (result == null) {<a name="line.809"></a>
- <span class="sourceLineNo">810</span> Plot parent = getParent();<a name="line.810"></a>
- <span class="sourceLineNo">811</span> if (parent instanceof XYPlot) {<a name="line.811"></a>
- <span class="sourceLineNo">812</span> XYPlot xy = (XYPlot) parent;<a name="line.812"></a>
- <span class="sourceLineNo">813</span> result = xy.getDomainAxis(index);<a name="line.813"></a>
- <span class="sourceLineNo">814</span> }<a name="line.814"></a>
- <span class="sourceLineNo">815</span> }<a name="line.815"></a>
- <span class="sourceLineNo">816</span> return result;<a name="line.816"></a>
- <span class="sourceLineNo">817</span> }<a name="line.817"></a>
- <span class="sourceLineNo">818</span><a name="line.818"></a>
- <span class="sourceLineNo">819</span> /**<a name="line.819"></a>
- <span class="sourceLineNo">820</span> * Sets the domain axis for the plot and sends a {@link PlotChangeEvent}<a name="line.820"></a>
- <span class="sourceLineNo">821</span> * to all registered listeners.<a name="line.821"></a>
- <span class="sourceLineNo">822</span> *<a name="line.822"></a>
- <span class="sourceLineNo">823</span> * @param axis the new axis (<code>null</code> permitted).<a name="line.823"></a>
- <span class="sourceLineNo">824</span> *<a name="line.824"></a>
- <span class="sourceLineNo">825</span> * @see #getDomainAxis()<a name="line.825"></a>
- <span class="sourceLineNo">826</span> * @see #setDomainAxis(int, ValueAxis)<a name="line.826"></a>
- <span class="sourceLineNo">827</span> */<a name="line.827"></a>
- <span class="sourceLineNo">828</span> public void setDomainAxis(ValueAxis axis) {<a name="line.828"></a>
- <span class="sourceLineNo">829</span> setDomainAxis(0, axis);<a name="line.829"></a>
- <span class="sourceLineNo">830</span> }<a name="line.830"></a>
- <span class="sourceLineNo">831</span><a name="line.831"></a>
- <span class="sourceLineNo">832</span> /**<a name="line.832"></a>
- <span class="sourceLineNo">833</span> * Sets a domain axis and sends a {@link PlotChangeEvent} to all<a name="line.833"></a>
- <span class="sourceLineNo">834</span> * registered listeners.<a name="line.834"></a>
- <span class="sourceLineNo">835</span> *<a name="line.835"></a>
- <span class="sourceLineNo">836</span> * @param index the axis index.<a name="line.836"></a>
- <span class="sourceLineNo">837</span> * @param axis the axis (<code>null</code> permitted).<a name="line.837"></a>
- <span class="sourceLineNo">838</span> *<a name="line.838"></a>
- <span class="sourceLineNo">839</span> * @see #getDomainAxis(int)<a name="line.839"></a>
- <span class="sourceLineNo">840</span> * @see #setRangeAxis(int, ValueAxis)<a name="line.840"></a>
- <span class="sourceLineNo">841</span> */<a name="line.841"></a>
- <span class="sourceLineNo">842</span> public void setDomainAxis(int index, ValueAxis axis) {<a name="line.842"></a>
- <span class="sourceLineNo">843</span> setDomainAxis(index, axis, true);<a name="line.843"></a>
- <span class="sourceLineNo">844</span> }<a name="line.844"></a>
- <span class="sourceLineNo">845</span><a name="line.845"></a>
- <span class="sourceLineNo">846</span> /**<a name="line.846"></a>
- <span class="sourceLineNo">847</span> * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to<a name="line.847"></a>
- <span class="sourceLineNo">848</span> * all registered listeners.<a name="line.848"></a>
- <span class="sourceLineNo">849</span> *<a name="line.849"></a>
- <span class="sourceLineNo">850</span> * @param index the axis index.<a name="line.850"></a>
- <span class="sourceLineNo">851</span> * @param axis the axis.<a name="line.851"></a>
- <span class="sourceLineNo">852</span> * @param notify notify listeners?<a name="line.852"></a>
- <span class="sourceLineNo">853</span> *<a name="line.853"></a>
- <span class="sourceLineNo">854</span> * @see #getDomainAxis(int)<a name="line.854"></a>
- <span class="sourceLineNo">855</span> */<a name="line.855"></a>
- <span class="sourceLineNo">856</span> public void setDomainAxis(int index, ValueAxis axis, boolean notify) {<a name="line.856"></a>
- <span class="sourceLineNo">857</span> ValueAxis existing = getDomainAxis(index);<a name="line.857"></a>
- <span class="sourceLineNo">858</span> if (existing != null) {<a name="line.858"></a>
- <span class="sourceLineNo">859</span> existing.removeChangeListener(this);<a name="line.859"></a>
- <span class="sourceLineNo">860</span> }<a name="line.860"></a>
- <span class="sourceLineNo">861</span> if (axis != null) {<a name="line.861"></a>
- <span class="sourceLineNo">862</span> axis.setPlot(this);<a name="line.862"></a>
- <span class="sourceLineNo">863</span> }<a name="line.863"></a>
- <span class="sourceLineNo">864</span> this.domainAxes.put(index, axis);<a name="line.864"></a>
- <span class="sourceLineNo">865</span> if (axis != null) {<a name="line.865"></a>
- <span class="sourceLineNo">866</span> axis.configure();<a name="line.866"></a>
- <span class="sourceLineNo">867</span> axis.addChangeListener(this);<a name="line.867"></a>
- <span class="sourceLineNo">868</span> }<a name="line.868"></a>
- <span class="sourceLineNo">869</span> if (notify) {<a name="line.869"></a>
- <span class="sourceLineNo">870</span> fireChangeEvent();<a name="line.870"></a>
- <span class="sourceLineNo">871</span> }<a name="line.871"></a>
- <span class="sourceLineNo">872</span> }<a name="line.872"></a>
- <span class="sourceLineNo">873</span><a name="line.873"></a>
- <span class="sourceLineNo">874</span> /**<a name="line.874"></a>
- <span class="sourceLineNo">875</span> * Sets the domain axes for this plot and sends a {@link PlotChangeEvent}<a name="line.875"></a>
- <span class="sourceLineNo">876</span> * to all registered listeners.<a name="line.876"></a>
- <span class="sourceLineNo">877</span> *<a name="line.877"></a>
- <span class="sourceLineNo">878</span> * @param axes the axes (<code>null</code> not permitted).<a name="line.878"></a>
- <span class="sourceLineNo">879</span> *<a name="line.879"></a>
- <span class="sourceLineNo">880</span> * @see #setRangeAxes(ValueAxis[])<a name="line.880"></a>
- <span class="sourceLineNo">881</span> */<a name="line.881"></a>
- <span class="sourceLineNo">882</span> public void setDomainAxes(ValueAxis[] axes) {<a name="line.882"></a>
- <span class="sourceLineNo">883</span> for (int i = 0; i < axes.length; i++) {<a name="line.883"></a>
- <span class="sourceLineNo">884</span> setDomainAxis(i, axes[i], false);<a name="line.884"></a>
- <span class="sourceLineNo">885</span> }<a name="line.885"></a>
- <span class="sourceLineNo">886</span> fireChangeEvent();<a name="line.886"></a>
- <span class="sourceLineNo">887</span> }<a name="line.887"></a>
- <span class="sourceLineNo">888</span><a name="line.888"></a>
- <span class="sourceLineNo">889</span> /**<a name="line.889"></a>
- <span class="sourceLineNo">890</span> * Returns the location of the primary domain axis.<a name="line.890"></a>
- <span class="sourceLineNo">891</span> *<a name="line.891"></a>
- <span class="sourceLineNo">892</span> * @return The location (never <code>null</code>).<a name="line.892"></a>
- <span class="sourceLineNo">893</span> *<a name="line.893"></a>
- <span class="sourceLineNo">894</span> * @see #setDomainAxisLocation(AxisLocation)<a name="line.894"></a>
- <span class="sourceLineNo">895</span> */<a name="line.895"></a>
- <span class="sourceLineNo">896</span> public AxisLocation getDomainAxisLocation() {<a name="line.896"></a>
- <span class="sourceLineNo">897</span> return (AxisLocation) this.domainAxisLocations.get(0);<a name="line.897"></a>
- <span class="sourceLineNo">898</span> }<a name="line.898"></a>
- <span class="sourceLineNo">899</span><a name="line.899"></a>
- <span class="sourceLineNo">900</span> /**<a name="line.900"></a>
- <span class="sourceLineNo">901</span> * Sets the location of the primary domain axis and sends a<a name="line.901"></a>
- <span class="sourceLineNo">902</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.902"></a>
- <span class="sourceLineNo">903</span> *<a name="line.903"></a>
- <span class="sourceLineNo">904</span> * @param location the location (<code>null</code> not permitted).<a name="line.904"></a>
- <span class="sourceLineNo">905</span> *<a name="line.905"></a>
- <span class="sourceLineNo">906</span> * @see #getDomainAxisLocation()<a name="line.906"></a>
- <span class="sourceLineNo">907</span> */<a name="line.907"></a>
- <span class="sourceLineNo">908</span> public void setDomainAxisLocation(AxisLocation location) {<a name="line.908"></a>
- <span class="sourceLineNo">909</span> // delegate...<a name="line.909"></a>
- <span class="sourceLineNo">910</span> setDomainAxisLocation(0, location, true);<a name="line.910"></a>
- <span class="sourceLineNo">911</span> }<a name="line.911"></a>
- <span class="sourceLineNo">912</span><a name="line.912"></a>
- <span class="sourceLineNo">913</span> /**<a name="line.913"></a>
- <span class="sourceLineNo">914</span> * Sets the location of the domain axis and, if requested, sends a<a name="line.914"></a>
- <span class="sourceLineNo">915</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.915"></a>
- <span class="sourceLineNo">916</span> *<a name="line.916"></a>
- <span class="sourceLineNo">917</span> * @param location the location (<code>null</code> not permitted).<a name="line.917"></a>
- <span class="sourceLineNo">918</span> * @param notify notify listeners?<a name="line.918"></a>
- <span class="sourceLineNo">919</span> *<a name="line.919"></a>
- <span class="sourceLineNo">920</span> * @see #getDomainAxisLocation()<a name="line.920"></a>
- <span class="sourceLineNo">921</span> */<a name="line.921"></a>
- <span class="sourceLineNo">922</span> public void setDomainAxisLocation(AxisLocation location, boolean notify) {<a name="line.922"></a>
- <span class="sourceLineNo">923</span> // delegate...<a name="line.923"></a>
- <span class="sourceLineNo">924</span> setDomainAxisLocation(0, location, notify);<a name="line.924"></a>
- <span class="sourceLineNo">925</span> }<a name="line.925"></a>
- <span class="sourceLineNo">926</span><a name="line.926"></a>
- <span class="sourceLineNo">927</span> /**<a name="line.927"></a>
- <span class="sourceLineNo">928</span> * Returns the edge for the primary domain axis (taking into account the<a name="line.928"></a>
- <span class="sourceLineNo">929</span> * plot's orientation).<a name="line.929"></a>
- <span class="sourceLineNo">930</span> *<a name="line.930"></a>
- <span class="sourceLineNo">931</span> * @return The edge.<a name="line.931"></a>
- <span class="sourceLineNo">932</span> *<a name="line.932"></a>
- <span class="sourceLineNo">933</span> * @see #getDomainAxisLocation()<a name="line.933"></a>
- <span class="sourceLineNo">934</span> * @see #getOrientation()<a name="line.934"></a>
- <span class="sourceLineNo">935</span> */<a name="line.935"></a>
- <span class="sourceLineNo">936</span> public RectangleEdge getDomainAxisEdge() {<a name="line.936"></a>
- <span class="sourceLineNo">937</span> return Plot.resolveDomainAxisLocation(getDomainAxisLocation(),<a name="line.937"></a>
- <span class="sourceLineNo">938</span> this.orientation);<a name="line.938"></a>
- <span class="sourceLineNo">939</span> }<a name="line.939"></a>
- <span class="sourceLineNo">940</span><a name="line.940"></a>
- <span class="sourceLineNo">941</span> /**<a name="line.941"></a>
- <span class="sourceLineNo">942</span> * Returns the number of domain axes.<a name="line.942"></a>
- <span class="sourceLineNo">943</span> *<a name="line.943"></a>
- <span class="sourceLineNo">944</span> * @return The axis count.<a name="line.944"></a>
- <span class="sourceLineNo">945</span> *<a name="line.945"></a>
- <span class="sourceLineNo">946</span> * @see #getRangeAxisCount()<a name="line.946"></a>
- <span class="sourceLineNo">947</span> */<a name="line.947"></a>
- <span class="sourceLineNo">948</span> public int getDomainAxisCount() {<a name="line.948"></a>
- <span class="sourceLineNo">949</span> return this.domainAxes.size();<a name="line.949"></a>
- <span class="sourceLineNo">950</span> }<a name="line.950"></a>
- <span class="sourceLineNo">951</span><a name="line.951"></a>
- <span class="sourceLineNo">952</span> /**<a name="line.952"></a>
- <span class="sourceLineNo">953</span> * Clears the domain axes from the plot and sends a {@link PlotChangeEvent}<a name="line.953"></a>
- <span class="sourceLineNo">954</span> * to all registered listeners.<a name="line.954"></a>
- <span class="sourceLineNo">955</span> *<a name="line.955"></a>
- <span class="sourceLineNo">956</span> * @see #clearRangeAxes()<a name="line.956"></a>
- <span class="sourceLineNo">957</span> */<a name="line.957"></a>
- <span class="sourceLineNo">958</span> public void clearDomainAxes() {<a name="line.958"></a>
- <span class="sourceLineNo">959</span> for (ValueAxis axis: this.domainAxes.values()) {<a name="line.959"></a>
- <span class="sourceLineNo">960</span> if (axis != null) {<a name="line.960"></a>
- <span class="sourceLineNo">961</span> axis.removeChangeListener(this);<a name="line.961"></a>
- <span class="sourceLineNo">962</span> }<a name="line.962"></a>
- <span class="sourceLineNo">963</span> }<a name="line.963"></a>
- <span class="sourceLineNo">964</span> this.domainAxes.clear();<a name="line.964"></a>
- <span class="sourceLineNo">965</span> fireChangeEvent();<a name="line.965"></a>
- <span class="sourceLineNo">966</span> }<a name="line.966"></a>
- <span class="sourceLineNo">967</span><a name="line.967"></a>
- <span class="sourceLineNo">968</span> /**<a name="line.968"></a>
- <span class="sourceLineNo">969</span> * Configures the domain axes.<a name="line.969"></a>
- <span class="sourceLineNo">970</span> */<a name="line.970"></a>
- <span class="sourceLineNo">971</span> public void configureDomainAxes() {<a name="line.971"></a>
- <span class="sourceLineNo">972</span> for (ValueAxis axis: this.domainAxes.values()) {<a name="line.972"></a>
- <span class="sourceLineNo">973</span> if (axis != null) {<a name="line.973"></a>
- <span class="sourceLineNo">974</span> axis.configure();<a name="line.974"></a>
- <span class="sourceLineNo">975</span> }<a name="line.975"></a>
- <span class="sourceLineNo">976</span> }<a name="line.976"></a>
- <span class="sourceLineNo">977</span> }<a name="line.977"></a>
- <span class="sourceLineNo">978</span><a name="line.978"></a>
- <span class="sourceLineNo">979</span> /**<a name="line.979"></a>
- <span class="sourceLineNo">980</span> * Returns the location for a domain axis. If this hasn't been set<a name="line.980"></a>
- <span class="sourceLineNo">981</span> * explicitly, the method returns the location that is opposite to the<a name="line.981"></a>
- <span class="sourceLineNo">982</span> * primary domain axis location.<a name="line.982"></a>
- <span class="sourceLineNo">983</span> *<a name="line.983"></a>
- <span class="sourceLineNo">984</span> * @param index the axis index (must be &gt;= 0).<a name="line.984"></a>
- <span class="sourceLineNo">985</span> *<a name="line.985"></a>
- <span class="sourceLineNo">986</span> * @return The location (never {@code null}).<a name="line.986"></a>
- <span class="sourceLineNo">987</span> *<a name="line.987"></a>
- <span class="sourceLineNo">988</span> * @see #setDomainAxisLocation(int, AxisLocation)<a name="line.988"></a>
- <span class="sourceLineNo">989</span> */<a name="line.989"></a>
- <span class="sourceLineNo">990</span> public AxisLocation getDomainAxisLocation(int index) {<a name="line.990"></a>
- <span class="sourceLineNo">991</span> AxisLocation result = this.domainAxisLocations.get(index);<a name="line.991"></a>
- <span class="sourceLineNo">992</span> if (result == null) {<a name="line.992"></a>
- <span class="sourceLineNo">993</span> result = AxisLocation.getOpposite(getDomainAxisLocation());<a name="line.993"></a>
- <span class="sourceLineNo">994</span> }<a name="line.994"></a>
- <span class="sourceLineNo">995</span> return result;<a name="line.995"></a>
- <span class="sourceLineNo">996</span> }<a name="line.996"></a>
- <span class="sourceLineNo">997</span><a name="line.997"></a>
- <span class="sourceLineNo">998</span> /**<a name="line.998"></a>
- <span class="sourceLineNo">999</span> * Sets the location for a domain axis and sends a {@link PlotChangeEvent}<a name="line.999"></a>
- <span class="sourceLineNo">1000</span> * to all registered listeners.<a name="line.1000"></a>
- <span class="sourceLineNo">1001</span> *<a name="line.1001"></a>
- <span class="sourceLineNo">1002</span> * @param index the axis index.<a name="line.1002"></a>
- <span class="sourceLineNo">1003</span> * @param location the location (<code>null</code> not permitted for index<a name="line.1003"></a>
- <span class="sourceLineNo">1004</span> * 0).<a name="line.1004"></a>
- <span class="sourceLineNo">1005</span> *<a name="line.1005"></a>
- <span class="sourceLineNo">1006</span> * @see #getDomainAxisLocation(int)<a name="line.1006"></a>
- <span class="sourceLineNo">1007</span> */<a name="line.1007"></a>
- <span class="sourceLineNo">1008</span> public void setDomainAxisLocation(int index, AxisLocation location) {<a name="line.1008"></a>
- <span class="sourceLineNo">1009</span> // delegate...<a name="line.1009"></a>
- <span class="sourceLineNo">1010</span> setDomainAxisLocation(index, location, true);<a name="line.1010"></a>
- <span class="sourceLineNo">1011</span> }<a name="line.1011"></a>
- <span class="sourceLineNo">1012</span><a name="line.1012"></a>
- <span class="sourceLineNo">1013</span> /**<a name="line.1013"></a>
- <span class="sourceLineNo">1014</span> * Sets the axis location for a domain axis and, if requested, sends a<a name="line.1014"></a>
- <span class="sourceLineNo">1015</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.1015"></a>
- <span class="sourceLineNo">1016</span> *<a name="line.1016"></a>
- <span class="sourceLineNo">1017</span> * @param index the axis index (must be &gt;= 0).<a name="line.1017"></a>
- <span class="sourceLineNo">1018</span> * @param location the location (<code>null</code> not permitted for<a name="line.1018"></a>
- <span class="sourceLineNo">1019</span> * index 0).<a name="line.1019"></a>
- <span class="sourceLineNo">1020</span> * @param notify notify listeners?<a name="line.1020"></a>
- <span class="sourceLineNo">1021</span> *<a name="line.1021"></a>
- <span class="sourceLineNo">1022</span> * @since 1.0.5<a name="line.1022"></a>
- <span class="sourceLineNo">1023</span> *<a name="line.1023"></a>
- <span class="sourceLineNo">1024</span> * @see #getDomainAxisLocation(int)<a name="line.1024"></a>
- <span class="sourceLineNo">1025</span> * @see #setRangeAxisLocation(int, AxisLocation, boolean)<a name="line.1025"></a>
- <span class="sourceLineNo">1026</span> */<a name="line.1026"></a>
- <span class="sourceLineNo">1027</span> public void setDomainAxisLocation(int index, AxisLocation location,<a name="line.1027"></a>
- <span class="sourceLineNo">1028</span> boolean notify) {<a name="line.1028"></a>
- <span class="sourceLineNo">1029</span> if (index == 0 && location == null) {<a name="line.1029"></a>
- <span class="sourceLineNo">1030</span> throw new IllegalArgumentException(<a name="line.1030"></a>
- <span class="sourceLineNo">1031</span> "Null 'location' for index 0 not permitted.");<a name="line.1031"></a>
- <span class="sourceLineNo">1032</span> }<a name="line.1032"></a>
- <span class="sourceLineNo">1033</span> this.domainAxisLocations.put(index, location);<a name="line.1033"></a>
- <span class="sourceLineNo">1034</span> if (notify) {<a name="line.1034"></a>
- <span class="sourceLineNo">1035</span> fireChangeEvent();<a name="line.1035"></a>
- <span class="sourceLineNo">1036</span> }<a name="line.1036"></a>
- <span class="sourceLineNo">1037</span> }<a name="line.1037"></a>
- <span class="sourceLineNo">1038</span><a name="line.1038"></a>
- <span class="sourceLineNo">1039</span> /**<a name="line.1039"></a>
- <span class="sourceLineNo">1040</span> * Returns the edge for a domain axis.<a name="line.1040"></a>
- <span class="sourceLineNo">1041</span> *<a name="line.1041"></a>
- <span class="sourceLineNo">1042</span> * @param index the axis index.<a name="line.1042"></a>
- <span class="sourceLineNo">1043</span> *<a name="line.1043"></a>
- <span class="sourceLineNo">1044</span> * @return The edge.<a name="line.1044"></a>
- <span class="sourceLineNo">1045</span> *<a name="line.1045"></a>
- <span class="sourceLineNo">1046</span> * @see #getRangeAxisEdge(int)<a name="line.1046"></a>
- <span class="sourceLineNo">1047</span> */<a name="line.1047"></a>
- <span class="sourceLineNo">1048</span> public RectangleEdge getDomainAxisEdge(int index) {<a name="line.1048"></a>
- <span class="sourceLineNo">1049</span> AxisLocation location = getDomainAxisLocation(index);<a name="line.1049"></a>
- <span class="sourceLineNo">1050</span> return Plot.resolveDomainAxisLocation(location, this.orientation);<a name="line.1050"></a>
- <span class="sourceLineNo">1051</span> }<a name="line.1051"></a>
- <span class="sourceLineNo">1052</span><a name="line.1052"></a>
- <span class="sourceLineNo">1053</span> /**<a name="line.1053"></a>
- <span class="sourceLineNo">1054</span> * Returns the range axis for the plot. If the range axis for this plot is<a name="line.1054"></a>
- <span class="sourceLineNo">1055</span> * <code>null</code>, then the method will return the parent plot's range<a name="line.1055"></a>
- <span class="sourceLineNo">1056</span> * axis (if there is a parent plot).<a name="line.1056"></a>
- <span class="sourceLineNo">1057</span> *<a name="line.1057"></a>
- <span class="sourceLineNo">1058</span> * @return The range axis.<a name="line.1058"></a>
- <span class="sourceLineNo">1059</span> *<a name="line.1059"></a>
- <span class="sourceLineNo">1060</span> * @see #getRangeAxis(int)<a name="line.1060"></a>
- <span class="sourceLineNo">1061</span> * @see #setRangeAxis(ValueAxis)<a name="line.1061"></a>
- <span class="sourceLineNo">1062</span> */<a name="line.1062"></a>
- <span class="sourceLineNo">1063</span> public ValueAxis getRangeAxis() {<a name="line.1063"></a>
- <span class="sourceLineNo">1064</span> return getRangeAxis(0);<a name="line.1064"></a>
- <span class="sourceLineNo">1065</span> }<a name="line.1065"></a>
- <span class="sourceLineNo">1066</span><a name="line.1066"></a>
- <span class="sourceLineNo">1067</span> /**<a name="line.1067"></a>
- <span class="sourceLineNo">1068</span> * Sets the range axis for the plot and sends a {@link PlotChangeEvent} to<a name="line.1068"></a>
- <span class="sourceLineNo">1069</span> * all registered listeners.<a name="line.1069"></a>
- <span class="sourceLineNo">1070</span> *<a name="line.1070"></a>
- <span class="sourceLineNo">1071</span> * @param axis the axis (<code>null</code> permitted).<a name="line.1071"></a>
- <span class="sourceLineNo">1072</span> *<a name="line.1072"></a>
- <span class="sourceLineNo">1073</span> * @see #getRangeAxis()<a name="line.1073"></a>
- <span class="sourceLineNo">1074</span> * @see #setRangeAxis(int, ValueAxis)<a name="line.1074"></a>
- <span class="sourceLineNo">1075</span> */<a name="line.1075"></a>
- <span class="sourceLineNo">1076</span> public void setRangeAxis(ValueAxis axis) {<a name="line.1076"></a>
- <span class="sourceLineNo">1077</span> if (axis != null) {<a name="line.1077"></a>
- <span class="sourceLineNo">1078</span> axis.setPlot(this);<a name="line.1078"></a>
- <span class="sourceLineNo">1079</span> }<a name="line.1079"></a>
- <span class="sourceLineNo">1080</span> // plot is likely registered as a listener with the existing axis...<a name="line.1080"></a>
- <span class="sourceLineNo">1081</span> ValueAxis existing = getRangeAxis();<a name="line.1081"></a>
- <span class="sourceLineNo">1082</span> if (existing != null) {<a name="line.1082"></a>
- <span class="sourceLineNo">1083</span> existing.removeChangeListener(this);<a name="line.1083"></a>
- <span class="sourceLineNo">1084</span> }<a name="line.1084"></a>
- <span class="sourceLineNo">1085</span> this.rangeAxes.put(0, axis);<a name="line.1085"></a>
- <span class="sourceLineNo">1086</span> if (axis != null) {<a name="line.1086"></a>
- <span class="sourceLineNo">1087</span> axis.configure();<a name="line.1087"></a>
- <span class="sourceLineNo">1088</span> axis.addChangeListener(this);<a name="line.1088"></a>
- <span class="sourceLineNo">1089</span> }<a name="line.1089"></a>
- <span class="sourceLineNo">1090</span> fireChangeEvent();<a name="line.1090"></a>
- <span class="sourceLineNo">1091</span> }<a name="line.1091"></a>
- <span class="sourceLineNo">1092</span><a name="line.1092"></a>
- <span class="sourceLineNo">1093</span> /**<a name="line.1093"></a>
- <span class="sourceLineNo">1094</span> * Returns the location of the primary range axis.<a name="line.1094"></a>
- <span class="sourceLineNo">1095</span> *<a name="line.1095"></a>
- <span class="sourceLineNo">1096</span> * @return The location (never <code>null</code>).<a name="line.1096"></a>
- <span class="sourceLineNo">1097</span> *<a name="line.1097"></a>
- <span class="sourceLineNo">1098</span> * @see #setRangeAxisLocation(AxisLocation)<a name="line.1098"></a>
- <span class="sourceLineNo">1099</span> */<a name="line.1099"></a>
- <span class="sourceLineNo">1100</span> public AxisLocation getRangeAxisLocation() {<a name="line.1100"></a>
- <span class="sourceLineNo">1101</span> return (AxisLocation) this.rangeAxisLocations.get(0);<a name="line.1101"></a>
- <span class="sourceLineNo">1102</span> }<a name="line.1102"></a>
- <span class="sourceLineNo">1103</span><a name="line.1103"></a>
- <span class="sourceLineNo">1104</span> /**<a name="line.1104"></a>
- <span class="sourceLineNo">1105</span> * Sets the location of the primary range axis and sends a<a name="line.1105"></a>
- <span class="sourceLineNo">1106</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.1106"></a>
- <span class="sourceLineNo">1107</span> *<a name="line.1107"></a>
- <span class="sourceLineNo">1108</span> * @param location the location (<code>null</code> not permitted).<a name="line.1108"></a>
- <span class="sourceLineNo">1109</span> *<a name="line.1109"></a>
- <span class="sourceLineNo">1110</span> * @see #getRangeAxisLocation()<a name="line.1110"></a>
- <span class="sourceLineNo">1111</span> */<a name="line.1111"></a>
- <span class="sourceLineNo">1112</span> public void setRangeAxisLocation(AxisLocation location) {<a name="line.1112"></a>
- <span class="sourceLineNo">1113</span> // delegate...<a name="line.1113"></a>
- <span class="sourceLineNo">1114</span> setRangeAxisLocation(0, location, true);<a name="line.1114"></a>
- <span class="sourceLineNo">1115</span> }<a name="line.1115"></a>
- <span class="sourceLineNo">1116</span><a name="line.1116"></a>
- <span class="sourceLineNo">1117</span> /**<a name="line.1117"></a>
- <span class="sourceLineNo">1118</span> * Sets the location of the primary range axis and, if requested, sends a<a name="line.1118"></a>
- <span class="sourceLineNo">1119</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.1119"></a>
- <span class="sourceLineNo">1120</span> *<a name="line.1120"></a>
- <span class="sourceLineNo">1121</span> * @param location the location (<code>null</code> not permitted).<a name="line.1121"></a>
- <span class="sourceLineNo">1122</span> * @param notify notify listeners?<a name="line.1122"></a>
- <span class="sourceLineNo">1123</span> *<a name="line.1123"></a>
- <span class="sourceLineNo">1124</span> * @see #getRangeAxisLocation()<a name="line.1124"></a>
- <span class="sourceLineNo">1125</span> */<a name="line.1125"></a>
- <span class="sourceLineNo">1126</span> public void setRangeAxisLocation(AxisLocation location, boolean notify) {<a name="line.1126"></a>
- <span class="sourceLineNo">1127</span> // delegate...<a name="line.1127"></a>
- <span class="sourceLineNo">1128</span> setRangeAxisLocation(0, location, notify);<a name="line.1128"></a>
- <span class="sourceLineNo">1129</span> }<a name="line.1129"></a>
- <span class="sourceLineNo">1130</span><a name="line.1130"></a>
- <span class="sourceLineNo">1131</span> /**<a name="line.1131"></a>
- <span class="sourceLineNo">1132</span> * Returns the edge for the primary range axis.<a name="line.1132"></a>
- <span class="sourceLineNo">1133</span> *<a name="line.1133"></a>
- <span class="sourceLineNo">1134</span> * @return The range axis edge.<a name="line.1134"></a>
- <span class="sourceLineNo">1135</span> *<a name="line.1135"></a>
- <span class="sourceLineNo">1136</span> * @see #getRangeAxisLocation()<a name="line.1136"></a>
- <span class="sourceLineNo">1137</span> * @see #getOrientation()<a name="line.1137"></a>
- <span class="sourceLineNo">1138</span> */<a name="line.1138"></a>
- <span class="sourceLineNo">1139</span> public RectangleEdge getRangeAxisEdge() {<a name="line.1139"></a>
- <span class="sourceLineNo">1140</span> return Plot.resolveRangeAxisLocation(getRangeAxisLocation(),<a name="line.1140"></a>
- <span class="sourceLineNo">1141</span> this.orientation);<a name="line.1141"></a>
- <span class="sourceLineNo">1142</span> }<a name="line.1142"></a>
- <span class="sourceLineNo">1143</span><a name="line.1143"></a>
- <span class="sourceLineNo">1144</span> /**<a name="line.1144"></a>
- <span class="sourceLineNo">1145</span> * Returns the range axis with the specified index, or {@code null} if <a name="line.1145"></a>
- <span class="sourceLineNo">1146</span> * there is no axis with that index.<a name="line.1146"></a>
- <span class="sourceLineNo">1147</span> *<a name="line.1147"></a>
- <span class="sourceLineNo">1148</span> * @param index the axis index (must be &gt;= 0).<a name="line.1148"></a>
- <span class="sourceLineNo">1149</span> *<a name="line.1149"></a>
- <span class="sourceLineNo">1150</span> * @return The axis ({@code null} possible).<a name="line.1150"></a>
- <span class="sourceLineNo">1151</span> *<a name="line.1151"></a>
- <span class="sourceLineNo">1152</span> * @see #setRangeAxis(int, ValueAxis)<a name="line.1152"></a>
- <span class="sourceLineNo">1153</span> */<a name="line.1153"></a>
- <span class="sourceLineNo">1154</span> public ValueAxis getRangeAxis(int index) {<a name="line.1154"></a>
- <span class="sourceLineNo">1155</span> ValueAxis result = this.rangeAxes.get(index);<a name="line.1155"></a>
- <span class="sourceLineNo">1156</span> if (result == null) {<a name="line.1156"></a>
- <span class="sourceLineNo">1157</span> Plot parent = getParent();<a name="line.1157"></a>
- <span class="sourceLineNo">1158</span> if (parent instanceof XYPlot) {<a name="line.1158"></a>
- <span class="sourceLineNo">1159</span> XYPlot xy = (XYPlot) parent;<a name="line.1159"></a>
- <span class="sourceLineNo">1160</span> result = xy.getRangeAxis(index);<a name="line.1160"></a>
- <span class="sourceLineNo">1161</span> }<a name="line.1161"></a>
- <span class="sourceLineNo">1162</span> }<a name="line.1162"></a>
- <span class="sourceLineNo">1163</span> return result;<a name="line.1163"></a>
- <span class="sourceLineNo">1164</span> }<a name="line.1164"></a>
- <span class="sourceLineNo">1165</span><a name="line.1165"></a>
- <span class="sourceLineNo">1166</span> /**<a name="line.1166"></a>
- <span class="sourceLineNo">1167</span> * Sets a range axis and sends a {@link PlotChangeEvent} to all registered<a name="line.1167"></a>
- <span class="sourceLineNo">1168</span> * listeners.<a name="line.1168"></a>
- <span class="sourceLineNo">1169</span> *<a name="line.1169"></a>
- <span class="sourceLineNo">1170</span> * @param index the axis index.<a name="line.1170"></a>
- <span class="sourceLineNo">1171</span> * @param axis the axis (<code>null</code> permitted).<a name="line.1171"></a>
- <span class="sourceLineNo">1172</span> *<a name="line.1172"></a>
- <span class="sourceLineNo">1173</span> * @see #getRangeAxis(int)<a name="line.1173"></a>
- <span class="sourceLineNo">1174</span> */<a name="line.1174"></a>
- <span class="sourceLineNo">1175</span> public void setRangeAxis(int index, ValueAxis axis) {<a name="line.1175"></a>
- <span class="sourceLineNo">1176</span> setRangeAxis(index, axis, true);<a name="line.1176"></a>
- <span class="sourceLineNo">1177</span> }<a name="line.1177"></a>
- <span class="sourceLineNo">1178</span><a name="line.1178"></a>
- <span class="sourceLineNo">1179</span> /**<a name="line.1179"></a>
- <span class="sourceLineNo">1180</span> * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to<a name="line.1180"></a>
- <span class="sourceLineNo">1181</span> * all registered listeners.<a name="line.1181"></a>
- <span class="sourceLineNo">1182</span> *<a name="line.1182"></a>
- <span class="sourceLineNo">1183</span> * @param index the axis index.<a name="line.1183"></a>
- <span class="sourceLineNo">1184</span> * @param axis the axis (<code>null</code> permitted).<a name="line.1184"></a>
- <span class="sourceLineNo">1185</span> * @param notify notify listeners?<a name="line.1185"></a>
- <span class="sourceLineNo">1186</span> *<a name="line.1186"></a>
- <span class="sourceLineNo">1187</span> * @see #getRangeAxis(int)<a name="line.1187"></a>
- <span class="sourceLineNo">1188</span> */<a name="line.1188"></a>
- <span class="sourceLineNo">1189</span> public void setRangeAxis(int index, ValueAxis axis, boolean notify) {<a name="line.1189"></a>
- <span class="sourceLineNo">1190</span> ValueAxis existing = getRangeAxis(index);<a name="line.1190"></a>
- <span class="sourceLineNo">1191</span> if (existing != null) {<a name="line.1191"></a>
- <span class="sourceLineNo">1192</span> existing.removeChangeListener(this);<a name="line.1192"></a>
- <span class="sourceLineNo">1193</span> }<a name="line.1193"></a>
- <span class="sourceLineNo">1194</span> if (axis != null) {<a name="line.1194"></a>
- <span class="sourceLineNo">1195</span> axis.setPlot(this);<a name="line.1195"></a>
- <span class="sourceLineNo">1196</span> }<a name="line.1196"></a>
- <span class="sourceLineNo">1197</span> this.rangeAxes.put(index, axis);<a name="line.1197"></a>
- <span class="sourceLineNo">1198</span> if (axis != null) {<a name="line.1198"></a>
- <span class="sourceLineNo">1199</span> axis.configure();<a name="line.1199"></a>
- <span class="sourceLineNo">1200</span> axis.addChangeListener(this);<a name="line.1200"></a>
- <span class="sourceLineNo">1201</span> }<a name="line.1201"></a>
- <span class="sourceLineNo">1202</span> if (notify) {<a name="line.1202"></a>
- <span class="sourceLineNo">1203</span> fireChangeEvent();<a name="line.1203"></a>
- <span class="sourceLineNo">1204</span> }<a name="line.1204"></a>
- <span class="sourceLineNo">1205</span> }<a name="line.1205"></a>
- <span class="sourceLineNo">1206</span><a name="line.1206"></a>
- <span class="sourceLineNo">1207</span> /**<a name="line.1207"></a>
- <span class="sourceLineNo">1208</span> * Sets the range axes for this plot and sends a {@link PlotChangeEvent}<a name="line.1208"></a>
- <span class="sourceLineNo">1209</span> * to all registered listeners.<a name="line.1209"></a>
- <span class="sourceLineNo">1210</span> *<a name="line.1210"></a>
- <span class="sourceLineNo">1211</span> * @param axes the axes (<code>null</code> not permitted).<a name="line.1211"></a>
- <span class="sourceLineNo">1212</span> *<a name="line.1212"></a>
- <span class="sourceLineNo">1213</span> * @see #setDomainAxes(ValueAxis[])<a name="line.1213"></a>
- <span class="sourceLineNo">1214</span> */<a name="line.1214"></a>
- <span class="sourceLineNo">1215</span> public void setRangeAxes(ValueAxis[] axes) {<a name="line.1215"></a>
- <span class="sourceLineNo">1216</span> for (int i = 0; i < axes.length; i++) {<a name="line.1216"></a>
- <span class="sourceLineNo">1217</span> setRangeAxis(i, axes[i], false);<a name="line.1217"></a>
- <span class="sourceLineNo">1218</span> }<a name="line.1218"></a>
- <span class="sourceLineNo">1219</span> fireChangeEvent();<a name="line.1219"></a>
- <span class="sourceLineNo">1220</span> }<a name="line.1220"></a>
- <span class="sourceLineNo">1221</span><a name="line.1221"></a>
- <span class="sourceLineNo">1222</span> /**<a name="line.1222"></a>
- <span class="sourceLineNo">1223</span> * Returns the number of range axes.<a name="line.1223"></a>
- <span class="sourceLineNo">1224</span> *<a name="line.1224"></a>
- <span class="sourceLineNo">1225</span> * @return The axis count.<a name="line.1225"></a>
- <span class="sourceLineNo">1226</span> *<a name="line.1226"></a>
- <span class="sourceLineNo">1227</span> * @see #getDomainAxisCount()<a name="line.1227"></a>
- <span class="sourceLineNo">1228</span> */<a name="line.1228"></a>
- <span class="sourceLineNo">1229</span> public int getRangeAxisCount() {<a name="line.1229"></a>
- <span class="sourceLineNo">1230</span> return this.rangeAxes.size();<a name="line.1230"></a>
- <span class="sourceLineNo">1231</span> }<a name="line.1231"></a>
- <span class="sourceLineNo">1232</span><a name="line.1232"></a>
- <span class="sourceLineNo">1233</span> /**<a name="line.1233"></a>
- <span class="sourceLineNo">1234</span> * Clears the range axes from the plot and sends a {@link PlotChangeEvent}<a name="line.1234"></a>
- <span class="sourceLineNo">1235</span> * to all registered listeners.<a name="line.1235"></a>
- <span class="sourceLineNo">1236</span> *<a name="line.1236"></a>
- <span class="sourceLineNo">1237</span> * @see #clearDomainAxes()<a name="line.1237"></a>
- <span class="sourceLineNo">1238</span> */<a name="line.1238"></a>
- <span class="sourceLineNo">1239</span> public void clearRangeAxes() {<a name="line.1239"></a>
- <span class="sourceLineNo">1240</span> for (ValueAxis axis: this.rangeAxes.values()) {<a name="line.1240"></a>
- <span class="sourceLineNo">1241</span> if (axis != null) {<a name="line.1241"></a>
- <span class="sourceLineNo">1242</span> axis.removeChangeListener(this);<a name="line.1242"></a>
- <span class="sourceLineNo">1243</span> }<a name="line.1243"></a>
- <span class="sourceLineNo">1244</span> }<a name="line.1244"></a>
- <span class="sourceLineNo">1245</span> this.rangeAxes.clear();<a name="line.1245"></a>
- <span class="sourceLineNo">1246</span> fireChangeEvent();<a name="line.1246"></a>
- <span class="sourceLineNo">1247</span> }<a name="line.1247"></a>
- <span class="sourceLineNo">1248</span><a name="line.1248"></a>
- <span class="sourceLineNo">1249</span> /**<a name="line.1249"></a>
- <span class="sourceLineNo">1250</span> * Configures the range axes.<a name="line.1250"></a>
- <span class="sourceLineNo">1251</span> *<a name="line.1251"></a>
- <span class="sourceLineNo">1252</span> * @see #configureDomainAxes()<a name="line.1252"></a>
- <span class="sourceLineNo">1253</span> */<a name="line.1253"></a>
- <span class="sourceLineNo">1254</span> public void configureRangeAxes() {<a name="line.1254"></a>
- <span class="sourceLineNo">1255</span> for (ValueAxis axis: this.rangeAxes.values()) {<a name="line.1255"></a>
- <span class="sourceLineNo">1256</span> if (axis != null) {<a name="line.1256"></a>
- <span class="sourceLineNo">1257</span> axis.configure();<a name="line.1257"></a>
- <span class="sourceLineNo">1258</span> }<a name="line.1258"></a>
- <span class="sourceLineNo">1259</span> }<a name="line.1259"></a>
- <span class="sourceLineNo">1260</span> }<a name="line.1260"></a>
- <span class="sourceLineNo">1261</span><a name="line.1261"></a>
- <span class="sourceLineNo">1262</span> /**<a name="line.1262"></a>
- <span class="sourceLineNo">1263</span> * Returns the location for a range axis. If this hasn't been set<a name="line.1263"></a>
- <span class="sourceLineNo">1264</span> * explicitly, the method returns the location that is opposite to the<a name="line.1264"></a>
- <span class="sourceLineNo">1265</span> * primary range axis location.<a name="line.1265"></a>
- <span class="sourceLineNo">1266</span> *<a name="line.1266"></a>
- <span class="sourceLineNo">1267</span> * @param index the axis index (must be &gt;= 0).<a name="line.1267"></a>
- <span class="sourceLineNo">1268</span> *<a name="line.1268"></a>
- <span class="sourceLineNo">1269</span> * @return The location (never {@code null}).<a name="line.1269"></a>
- <span class="sourceLineNo">1270</span> *<a name="line.1270"></a>
- <span class="sourceLineNo">1271</span> * @see #setRangeAxisLocation(int, AxisLocation)<a name="line.1271"></a>
- <span class="sourceLineNo">1272</span> */<a name="line.1272"></a>
- <span class="sourceLineNo">1273</span> public AxisLocation getRangeAxisLocation(int index) {<a name="line.1273"></a>
- <span class="sourceLineNo">1274</span> AxisLocation result = this.rangeAxisLocations.get(index);<a name="line.1274"></a>
- <span class="sourceLineNo">1275</span> if (result == null) {<a name="line.1275"></a>
- <span class="sourceLineNo">1276</span> result = AxisLocation.getOpposite(getRangeAxisLocation());<a name="line.1276"></a>
- <span class="sourceLineNo">1277</span> }<a name="line.1277"></a>
- <span class="sourceLineNo">1278</span> return result;<a name="line.1278"></a>
- <span class="sourceLineNo">1279</span> }<a name="line.1279"></a>
- <span class="sourceLineNo">1280</span><a name="line.1280"></a>
- <span class="sourceLineNo">1281</span> /**<a name="line.1281"></a>
- <span class="sourceLineNo">1282</span> * Sets the location for a range axis and sends a {@link PlotChangeEvent}<a name="line.1282"></a>
- <span class="sourceLineNo">1283</span> * to all registered listeners.<a name="line.1283"></a>
- <span class="sourceLineNo">1284</span> *<a name="line.1284"></a>
- <span class="sourceLineNo">1285</span> * @param index the axis index.<a name="line.1285"></a>
- <span class="sourceLineNo">1286</span> * @param location the location (<code>null</code> permitted).<a name="line.1286"></a>
- <span class="sourceLineNo">1287</span> *<a name="line.1287"></a>
- <span class="sourceLineNo">1288</span> * @see #getRangeAxisLocation(int)<a name="line.1288"></a>
- <span class="sourceLineNo">1289</span> */<a name="line.1289"></a>
- <span class="sourceLineNo">1290</span> public void setRangeAxisLocation(int index, AxisLocation location) {<a name="line.1290"></a>
- <span class="sourceLineNo">1291</span> // delegate...<a name="line.1291"></a>
- <span class="sourceLineNo">1292</span> setRangeAxisLocation(index, location, true);<a name="line.1292"></a>
- <span class="sourceLineNo">1293</span> }<a name="line.1293"></a>
- <span class="sourceLineNo">1294</span><a name="line.1294"></a>
- <span class="sourceLineNo">1295</span> /**<a name="line.1295"></a>
- <span class="sourceLineNo">1296</span> * Sets the axis location for a domain axis and, if requested, sends a<a name="line.1296"></a>
- <span class="sourceLineNo">1297</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.1297"></a>
- <span class="sourceLineNo">1298</span> *<a name="line.1298"></a>
- <span class="sourceLineNo">1299</span> * @param index the axis index.<a name="line.1299"></a>
- <span class="sourceLineNo">1300</span> * @param location the location (<code>null</code> not permitted for<a name="line.1300"></a>
- <span class="sourceLineNo">1301</span> * index 0).<a name="line.1301"></a>
- <span class="sourceLineNo">1302</span> * @param notify notify listeners?<a name="line.1302"></a>
- <span class="sourceLineNo">1303</span> *<a name="line.1303"></a>
- <span class="sourceLineNo">1304</span> * @since 1.0.5<a name="line.1304"></a>
- <span class="sourceLineNo">1305</span> *<a name="line.1305"></a>
- <span class="sourceLineNo">1306</span> * @see #getRangeAxisLocation(int)<a name="line.1306"></a>
- <span class="sourceLineNo">1307</span> * @see #setDomainAxisLocation(int, AxisLocation, boolean)<a name="line.1307"></a>
- <span class="sourceLineNo">1308</span> */<a name="line.1308"></a>
- <span class="sourceLineNo">1309</span> public void setRangeAxisLocation(int index, AxisLocation location,<a name="line.1309"></a>
- <span class="sourceLineNo">1310</span> boolean notify) {<a name="line.1310"></a>
- <span class="sourceLineNo">1311</span> if (index == 0 && location == null) {<a name="line.1311"></a>
- <span class="sourceLineNo">1312</span> throw new IllegalArgumentException(<a name="line.1312"></a>
- <span class="sourceLineNo">1313</span> "Null 'location' for index 0 not permitted.");<a name="line.1313"></a>
- <span class="sourceLineNo">1314</span> }<a name="line.1314"></a>
- <span class="sourceLineNo">1315</span> this.rangeAxisLocations.put(index, location);<a name="line.1315"></a>
- <span class="sourceLineNo">1316</span> if (notify) {<a name="line.1316"></a>
- <span class="sourceLineNo">1317</span> fireChangeEvent();<a name="line.1317"></a>
- <span class="sourceLineNo">1318</span> }<a name="line.1318"></a>
- <span class="sourceLineNo">1319</span> }<a name="line.1319"></a>
- <span class="sourceLineNo">1320</span><a name="line.1320"></a>
- <span class="sourceLineNo">1321</span> /**<a name="line.1321"></a>
- <span class="sourceLineNo">1322</span> * Returns the edge for a range axis.<a name="line.1322"></a>
- <span class="sourceLineNo">1323</span> *<a name="line.1323"></a>
- <span class="sourceLineNo">1324</span> * @param index the axis index.<a name="line.1324"></a>
- <span class="sourceLineNo">1325</span> *<a name="line.1325"></a>
- <span class="sourceLineNo">1326</span> * @return The edge.<a name="line.1326"></a>
- <span class="sourceLineNo">1327</span> *<a name="line.1327"></a>
- <span class="sourceLineNo">1328</span> * @see #getRangeAxisLocation(int)<a name="line.1328"></a>
- <span class="sourceLineNo">1329</span> * @see #getOrientation()<a name="line.1329"></a>
- <span class="sourceLineNo">1330</span> */<a name="line.1330"></a>
- <span class="sourceLineNo">1331</span> public RectangleEdge getRangeAxisEdge(int index) {<a name="line.1331"></a>
- <span class="sourceLineNo">1332</span> AxisLocation location = getRangeAxisLocation(index);<a name="line.1332"></a>
- <span class="sourceLineNo">1333</span> return Plot.resolveRangeAxisLocation(location, this.orientation);<a name="line.1333"></a>
- <span class="sourceLineNo">1334</span> }<a name="line.1334"></a>
- <span class="sourceLineNo">1335</span><a name="line.1335"></a>
- <span class="sourceLineNo">1336</span> /**<a name="line.1336"></a>
- <span class="sourceLineNo">1337</span> * Returns the primary dataset for the plot.<a name="line.1337"></a>
- <span class="sourceLineNo">1338</span> *<a name="line.1338"></a>
- <span class="sourceLineNo">1339</span> * @return The primary dataset (possibly <code>null</code>).<a name="line.1339"></a>
- <span class="sourceLineNo">1340</span> *<a name="line.1340"></a>
- <span class="sourceLineNo">1341</span> * @see #getDataset(int)<a name="line.1341"></a>
- <span class="sourceLineNo">1342</span> * @see #setDataset(XYDataset)<a name="line.1342"></a>
- <span class="sourceLineNo">1343</span> */<a name="line.1343"></a>
- <span class="sourceLineNo">1344</span> public XYDataset getDataset() {<a name="line.1344"></a>
- <span class="sourceLineNo">1345</span> return getDataset(0);<a name="line.1345"></a>
- <span class="sourceLineNo">1346</span> }<a name="line.1346"></a>
- <span class="sourceLineNo">1347</span><a name="line.1347"></a>
- <span class="sourceLineNo">1348</span> /**<a name="line.1348"></a>
- <span class="sourceLineNo">1349</span> * Returns the dataset with the specified index, or {@code null} if there<a name="line.1349"></a>
- <span class="sourceLineNo">1350</span> * is no dataset with that index.<a name="line.1350"></a>
- <span class="sourceLineNo">1351</span> *<a name="line.1351"></a>
- <span class="sourceLineNo">1352</span> * @param index the dataset index (must be &gt;= 0).<a name="line.1352"></a>
- <span class="sourceLineNo">1353</span> *<a name="line.1353"></a>
- <span class="sourceLineNo">1354</span> * @return The dataset (possibly {@code null}).<a name="line.1354"></a>
- <span class="sourceLineNo">1355</span> *<a name="line.1355"></a>
- <span class="sourceLineNo">1356</span> * @see #setDataset(int, XYDataset)<a name="line.1356"></a>
- <span class="sourceLineNo">1357</span> */<a name="line.1357"></a>
- <span class="sourceLineNo">1358</span> public XYDataset getDataset(int index) {<a name="line.1358"></a>
- <span class="sourceLineNo">1359</span> return (XYDataset) this.datasets.get(index);<a name="line.1359"></a>
- <span class="sourceLineNo">1360</span> }<a name="line.1360"></a>
- <span class="sourceLineNo">1361</span><a name="line.1361"></a>
- <span class="sourceLineNo">1362</span> /**<a name="line.1362"></a>
- <span class="sourceLineNo">1363</span> * Sets the primary dataset for the plot, replacing the existing dataset if<a name="line.1363"></a>
- <span class="sourceLineNo">1364</span> * there is one.<a name="line.1364"></a>
- <span class="sourceLineNo">1365</span> *<a name="line.1365"></a>
- <span class="sourceLineNo">1366</span> * @param dataset the dataset ({@code null} permitted).<a name="line.1366"></a>
- <span class="sourceLineNo">1367</span> *<a name="line.1367"></a>
- <span class="sourceLineNo">1368</span> * @see #getDataset()<a name="line.1368"></a>
- <span class="sourceLineNo">1369</span> * @see #setDataset(int, XYDataset)<a name="line.1369"></a>
- <span class="sourceLineNo">1370</span> */<a name="line.1370"></a>
- <span class="sourceLineNo">1371</span> public void setDataset(XYDataset dataset) {<a name="line.1371"></a>
- <span class="sourceLineNo">1372</span> setDataset(0, dataset);<a name="line.1372"></a>
- <span class="sourceLineNo">1373</span> }<a name="line.1373"></a>
- <span class="sourceLineNo">1374</span><a name="line.1374"></a>
- <span class="sourceLineNo">1375</span> /**<a name="line.1375"></a>
- <span class="sourceLineNo">1376</span> * Sets a dataset for the plot and sends a change event to all registered<a name="line.1376"></a>
- <span class="sourceLineNo">1377</span> * listeners.<a name="line.1377"></a>
- <span class="sourceLineNo">1378</span> *<a name="line.1378"></a>
- <span class="sourceLineNo">1379</span> * @param index the dataset index (must be &gt;= 0).<a name="line.1379"></a>
- <span class="sourceLineNo">1380</span> * @param dataset the dataset (<code>null</code> permitted).<a name="line.1380"></a>
- <span class="sourceLineNo">1381</span> *<a name="line.1381"></a>
- <span class="sourceLineNo">1382</span> * @see #getDataset(int)<a name="line.1382"></a>
- <span class="sourceLineNo">1383</span> */<a name="line.1383"></a>
- <span class="sourceLineNo">1384</span> public void setDataset(int index, XYDataset dataset) {<a name="line.1384"></a>
- <span class="sourceLineNo">1385</span> XYDataset existing = getDataset(index);<a name="line.1385"></a>
- <span class="sourceLineNo">1386</span> if (existing != null) {<a name="line.1386"></a>
- <span class="sourceLineNo">1387</span> existing.removeChangeListener(this);<a name="line.1387"></a>
- <span class="sourceLineNo">1388</span> }<a name="line.1388"></a>
- <span class="sourceLineNo">1389</span> this.datasets.put(index, dataset);<a name="line.1389"></a>
- <span class="sourceLineNo">1390</span> if (dataset != null) {<a name="line.1390"></a>
- <span class="sourceLineNo">1391</span> dataset.addChangeListener(this);<a name="line.1391"></a>
- <span class="sourceLineNo">1392</span> }<a name="line.1392"></a>
- <span class="sourceLineNo">1393</span><a name="line.1393"></a>
- <span class="sourceLineNo">1394</span> // send a dataset change event to self...<a name="line.1394"></a>
- <span class="sourceLineNo">1395</span> DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);<a name="line.1395"></a>
- <span class="sourceLineNo">1396</span> datasetChanged(event);<a name="line.1396"></a>
- <span class="sourceLineNo">1397</span> }<a name="line.1397"></a>
- <span class="sourceLineNo">1398</span><a name="line.1398"></a>
- <span class="sourceLineNo">1399</span> /**<a name="line.1399"></a>
- <span class="sourceLineNo">1400</span> * Returns the number of datasets.<a name="line.1400"></a>
- <span class="sourceLineNo">1401</span> *<a name="line.1401"></a>
- <span class="sourceLineNo">1402</span> * @return The number of datasets.<a name="line.1402"></a>
- <span class="sourceLineNo">1403</span> */<a name="line.1403"></a>
- <span class="sourceLineNo">1404</span> public int getDatasetCount() {<a name="line.1404"></a>
- <span class="sourceLineNo">1405</span> return this.datasets.size();<a name="line.1405"></a>
- <span class="sourceLineNo">1406</span> }<a name="line.1406"></a>
- <span class="sourceLineNo">1407</span><a name="line.1407"></a>
- <span class="sourceLineNo">1408</span> /**<a name="line.1408"></a>
- <span class="sourceLineNo">1409</span> * Returns the index of the specified dataset, or {@code -1} if the<a name="line.1409"></a>
- <span class="sourceLineNo">1410</span> * dataset does not belong to the plot.<a name="line.1410"></a>
- <span class="sourceLineNo">1411</span> *<a name="line.1411"></a>
- <span class="sourceLineNo">1412</span> * @param dataset the dataset ({@code null} not permitted).<a name="line.1412"></a>
- <span class="sourceLineNo">1413</span> *<a name="line.1413"></a>
- <span class="sourceLineNo">1414</span> * @return The index or -1.<a name="line.1414"></a>
- <span class="sourceLineNo">1415</span> */<a name="line.1415"></a>
- <span class="sourceLineNo">1416</span> public int indexOf(XYDataset dataset) {<a name="line.1416"></a>
- <span class="sourceLineNo">1417</span> for (Map.Entry<Integer, XYDataset> entry: this.datasets.entrySet()) {<a name="line.1417"></a>
- <span class="sourceLineNo">1418</span> if (dataset == entry.getValue()) {<a name="line.1418"></a>
- <span class="sourceLineNo">1419</span> return entry.getKey();<a name="line.1419"></a>
- <span class="sourceLineNo">1420</span> }<a name="line.1420"></a>
- <span class="sourceLineNo">1421</span> }<a name="line.1421"></a>
- <span class="sourceLineNo">1422</span> return -1;<a name="line.1422"></a>
- <span class="sourceLineNo">1423</span> }<a name="line.1423"></a>
- <span class="sourceLineNo">1424</span><a name="line.1424"></a>
- <span class="sourceLineNo">1425</span> /**<a name="line.1425"></a>
- <span class="sourceLineNo">1426</span> * Maps a dataset to a particular domain axis. All data will be plotted<a name="line.1426"></a>
- <span class="sourceLineNo">1427</span> * against axis zero by default, no mapping is required for this case.<a name="line.1427"></a>
- <span class="sourceLineNo">1428</span> *<a name="line.1428"></a>
- <span class="sourceLineNo">1429</span> * @param index the dataset index (zero-based).<a name="line.1429"></a>
- <span class="sourceLineNo">1430</span> * @param axisIndex the axis index.<a name="line.1430"></a>
- <span class="sourceLineNo">1431</span> *<a name="line.1431"></a>
- <span class="sourceLineNo">1432</span> * @see #mapDatasetToRangeAxis(int, int)<a name="line.1432"></a>
- <span class="sourceLineNo">1433</span> */<a name="line.1433"></a>
- <span class="sourceLineNo">1434</span> public void mapDatasetToDomainAxis(int index, int axisIndex) {<a name="line.1434"></a>
- <span class="sourceLineNo">1435</span> List axisIndices = new java.util.ArrayList(1);<a name="line.1435"></a>
- <span class="sourceLineNo">1436</span> axisIndices.add(new Integer(axisIndex));<a name="line.1436"></a>
- <span class="sourceLineNo">1437</span> mapDatasetToDomainAxes(index, axisIndices);<a name="line.1437"></a>
- <span class="sourceLineNo">1438</span> }<a name="line.1438"></a>
- <span class="sourceLineNo">1439</span><a name="line.1439"></a>
- <span class="sourceLineNo">1440</span> /**<a name="line.1440"></a>
- <span class="sourceLineNo">1441</span> * Maps the specified dataset to the axes in the list. Note that the<a name="line.1441"></a>
- <span class="sourceLineNo">1442</span> * conversion of data values into Java2D space is always performed using<a name="line.1442"></a>
- <span class="sourceLineNo">1443</span> * the first axis in the list.<a name="line.1443"></a>
- <span class="sourceLineNo">1444</span> *<a name="line.1444"></a>
- <span class="sourceLineNo">1445</span> * @param index the dataset index (zero-based).<a name="line.1445"></a>
- <span class="sourceLineNo">1446</span> * @param axisIndices the axis indices (<code>null</code> permitted).<a name="line.1446"></a>
- <span class="sourceLineNo">1447</span> *<a name="line.1447"></a>
- <span class="sourceLineNo">1448</span> * @since 1.0.12<a name="line.1448"></a>
- <span class="sourceLineNo">1449</span> */<a name="line.1449"></a>
- <span class="sourceLineNo">1450</span> public void mapDatasetToDomainAxes(int index, List axisIndices) {<a name="line.1450"></a>
- <span class="sourceLineNo">1451</span> ParamChecks.requireNonNegative(index, "index");<a name="line.1451"></a>
- <span class="sourceLineNo">1452</span> checkAxisIndices(axisIndices);<a name="line.1452"></a>
- <span class="sourceLineNo">1453</span> Integer key = new Integer(index);<a name="line.1453"></a>
- <span class="sourceLineNo">1454</span> this.datasetToDomainAxesMap.put(key, new ArrayList(axisIndices));<a name="line.1454"></a>
- <span class="sourceLineNo">1455</span> // fake a dataset change event to update axes...<a name="line.1455"></a>
- <span class="sourceLineNo">1456</span> datasetChanged(new DatasetChangeEvent(this, getDataset(index)));<a name="line.1456"></a>
- <span class="sourceLineNo">1457</span> }<a name="line.1457"></a>
- <span class="sourceLineNo">1458</span><a name="line.1458"></a>
- <span class="sourceLineNo">1459</span> /**<a name="line.1459"></a>
- <span class="sourceLineNo">1460</span> * Maps a dataset to a particular range axis. All data will be plotted<a name="line.1460"></a>
- <span class="sourceLineNo">1461</span> * against axis zero by default, no mapping is required for this case.<a name="line.1461"></a>
- <span class="sourceLineNo">1462</span> *<a name="line.1462"></a>
- <span class="sourceLineNo">1463</span> * @param index the dataset index (zero-based).<a name="line.1463"></a>
- <span class="sourceLineNo">1464</span> * @param axisIndex the axis index.<a name="line.1464"></a>
- <span class="sourceLineNo">1465</span> *<a name="line.1465"></a>
- <span class="sourceLineNo">1466</span> * @see #mapDatasetToDomainAxis(int, int)<a name="line.1466"></a>
- <span class="sourceLineNo">1467</span> */<a name="line.1467"></a>
- <span class="sourceLineNo">1468</span> public void mapDatasetToRangeAxis(int index, int axisIndex) {<a name="line.1468"></a>
- <span class="sourceLineNo">1469</span> List axisIndices = new java.util.ArrayList(1);<a name="line.1469"></a>
- <span class="sourceLineNo">1470</span> axisIndices.add(new Integer(axisIndex));<a name="line.1470"></a>
- <span class="sourceLineNo">1471</span> mapDatasetToRangeAxes(index, axisIndices);<a name="line.1471"></a>
- <span class="sourceLineNo">1472</span> }<a name="line.1472"></a>
- <span class="sourceLineNo">1473</span><a name="line.1473"></a>
- <span class="sourceLineNo">1474</span> /**<a name="line.1474"></a>
- <span class="sourceLineNo">1475</span> * Maps the specified dataset to the axes in the list. Note that the<a name="line.1475"></a>
- <span class="sourceLineNo">1476</span> * conversion of data values into Java2D space is always performed using<a name="line.1476"></a>
- <span class="sourceLineNo">1477</span> * the first axis in the list.<a name="line.1477"></a>
- <span class="sourceLineNo">1478</span> *<a name="line.1478"></a>
- <span class="sourceLineNo">1479</span> * @param index the dataset index (zero-based).<a name="line.1479"></a>
- <span class="sourceLineNo">1480</span> * @param axisIndices the axis indices (<code>null</code> permitted).<a name="line.1480"></a>
- <span class="sourceLineNo">1481</span> *<a name="line.1481"></a>
- <span class="sourceLineNo">1482</span> * @since 1.0.12<a name="line.1482"></a>
- <span class="sourceLineNo">1483</span> */<a name="line.1483"></a>
- <span class="sourceLineNo">1484</span> public void mapDatasetToRangeAxes(int index, List axisIndices) {<a name="line.1484"></a>
- <span class="sourceLineNo">1485</span> ParamChecks.requireNonNegative(index, "index");<a name="line.1485"></a>
- <span class="sourceLineNo">1486</span> checkAxisIndices(axisIndices);<a name="line.1486"></a>
- <span class="sourceLineNo">1487</span> Integer key = new Integer(index);<a name="line.1487"></a>
- <span class="sourceLineNo">1488</span> this.datasetToRangeAxesMap.put(key, new ArrayList(axisIndices));<a name="line.1488"></a>
- <span class="sourceLineNo">1489</span> // fake a dataset change event to update axes...<a name="line.1489"></a>
- <span class="sourceLineNo">1490</span> datasetChanged(new DatasetChangeEvent(this, getDataset(index)));<a name="line.1490"></a>
- <span class="sourceLineNo">1491</span> }<a name="line.1491"></a>
- <span class="sourceLineNo">1492</span><a name="line.1492"></a>
- <span class="sourceLineNo">1493</span> /**<a name="line.1493"></a>
- <span class="sourceLineNo">1494</span> * This method is used to perform argument checking on the list of<a name="line.1494"></a>
- <span class="sourceLineNo">1495</span> * axis indices passed to mapDatasetToDomainAxes() and<a name="line.1495"></a>
- <span class="sourceLineNo">1496</span> * mapDatasetToRangeAxes().<a name="line.1496"></a>
- <span class="sourceLineNo">1497</span> *<a name="line.1497"></a>
- <span class="sourceLineNo">1498</span> * @param indices the list of indices (<code>null</code> permitted).<a name="line.1498"></a>
- <span class="sourceLineNo">1499</span> */<a name="line.1499"></a>
- <span class="sourceLineNo">1500</span> private void checkAxisIndices(List<Integer> indices) {<a name="line.1500"></a>
- <span class="sourceLineNo">1501</span> // axisIndices can be:<a name="line.1501"></a>
- <span class="sourceLineNo">1502</span> // 1. null;<a name="line.1502"></a>
- <span class="sourceLineNo">1503</span> // 2. non-empty, containing only Integer objects that are unique.<a name="line.1503"></a>
- <span class="sourceLineNo">1504</span> if (indices == null) {<a name="line.1504"></a>
- <span class="sourceLineNo">1505</span> return; // OK<a name="line.1505"></a>
- <span class="sourceLineNo">1506</span> }<a name="line.1506"></a>
- <span class="sourceLineNo">1507</span> int count = indices.size();<a name="line.1507"></a>
- <span class="sourceLineNo">1508</span> if (count == 0) {<a name="line.1508"></a>
- <span class="sourceLineNo">1509</span> throw new IllegalArgumentException("Empty list not permitted.");<a name="line.1509"></a>
- <span class="sourceLineNo">1510</span> }<a name="line.1510"></a>
- <span class="sourceLineNo">1511</span> Set<Integer> set = new HashSet<Integer>();<a name="line.1511"></a>
- <span class="sourceLineNo">1512</span> for (Integer item : indices) {<a name="line.1512"></a>
- <span class="sourceLineNo">1513</span> if (set.contains(item)) {<a name="line.1513"></a>
- <span class="sourceLineNo">1514</span> throw new IllegalArgumentException("Indices must be unique.");<a name="line.1514"></a>
- <span class="sourceLineNo">1515</span> }<a name="line.1515"></a>
- <span class="sourceLineNo">1516</span> set.add(item);<a name="line.1516"></a>
- <span class="sourceLineNo">1517</span> }<a name="line.1517"></a>
- <span class="sourceLineNo">1518</span> }<a name="line.1518"></a>
- <span class="sourceLineNo">1519</span><a name="line.1519"></a>
- <span class="sourceLineNo">1520</span> /**<a name="line.1520"></a>
- <span class="sourceLineNo">1521</span> * Returns the number of renderer slots for this plot.<a name="line.1521"></a>
- <span class="sourceLineNo">1522</span> *<a name="line.1522"></a>
- <span class="sourceLineNo">1523</span> * @return The number of renderer slots.<a name="line.1523"></a>
- <span class="sourceLineNo">1524</span> *<a name="line.1524"></a>
- <span class="sourceLineNo">1525</span> * @since 1.0.11<a name="line.1525"></a>
- <span class="sourceLineNo">1526</span> */<a name="line.1526"></a>
- <span class="sourceLineNo">1527</span> public int getRendererCount() {<a name="line.1527"></a>
- <span class="sourceLineNo">1528</span> return this.renderers.size();<a name="line.1528"></a>
- <span class="sourceLineNo">1529</span> }<a name="line.1529"></a>
- <span class="sourceLineNo">1530</span><a name="line.1530"></a>
- <span class="sourceLineNo">1531</span> /**<a name="line.1531"></a>
- <span class="sourceLineNo">1532</span> * Returns the renderer for the primary dataset.<a name="line.1532"></a>
- <span class="sourceLineNo">1533</span> *<a name="line.1533"></a>
- <span class="sourceLineNo">1534</span> * @return The item renderer (possibly <code>null</code>).<a name="line.1534"></a>
- <span class="sourceLineNo">1535</span> *<a name="line.1535"></a>
- <span class="sourceLineNo">1536</span> * @see #setRenderer(XYItemRenderer)<a name="line.1536"></a>
- <span class="sourceLineNo">1537</span> */<a name="line.1537"></a>
- <span class="sourceLineNo">1538</span> public XYItemRenderer getRenderer() {<a name="line.1538"></a>
- <span class="sourceLineNo">1539</span> return getRenderer(0);<a name="line.1539"></a>
- <span class="sourceLineNo">1540</span> }<a name="line.1540"></a>
- <span class="sourceLineNo">1541</span><a name="line.1541"></a>
- <span class="sourceLineNo">1542</span> /**<a name="line.1542"></a>
- <span class="sourceLineNo">1543</span> * Returns the renderer with the specified index, or {@code null}.<a name="line.1543"></a>
- <span class="sourceLineNo">1544</span> *<a name="line.1544"></a>
- <span class="sourceLineNo">1545</span> * @param index the renderer index (must be &gt;= 0).<a name="line.1545"></a>
- <span class="sourceLineNo">1546</span> *<a name="line.1546"></a>
- <span class="sourceLineNo">1547</span> * @return The renderer (possibly {@code null}).<a name="line.1547"></a>
- <span class="sourceLineNo">1548</span> *<a name="line.1548"></a>
- <span class="sourceLineNo">1549</span> * @see #setRenderer(int, XYItemRenderer)<a name="line.1549"></a>
- <span class="sourceLineNo">1550</span> */<a name="line.1550"></a>
- <span class="sourceLineNo">1551</span> public XYItemRenderer getRenderer(int index) {<a name="line.1551"></a>
- <span class="sourceLineNo">1552</span> return (XYItemRenderer) this.renderers.get(index);<a name="line.1552"></a>
- <span class="sourceLineNo">1553</span> }<a name="line.1553"></a>
- <span class="sourceLineNo">1554</span><a name="line.1554"></a>
- <span class="sourceLineNo">1555</span> /**<a name="line.1555"></a>
- <span class="sourceLineNo">1556</span> * Sets the renderer for the primary dataset and sends a change event to <a name="line.1556"></a>
- <span class="sourceLineNo">1557</span> * all registered listeners. If the renderer is set to <code>null</code>, <a name="line.1557"></a>
- <span class="sourceLineNo">1558</span> * no data will be displayed.<a name="line.1558"></a>
- <span class="sourceLineNo">1559</span> *<a name="line.1559"></a>
- <span class="sourceLineNo">1560</span> * @param renderer the renderer ({@code null} permitted).<a name="line.1560"></a>
- <span class="sourceLineNo">1561</span> *<a name="line.1561"></a>
- <span class="sourceLineNo">1562</span> * @see #getRenderer()<a name="line.1562"></a>
- <span class="sourceLineNo">1563</span> */<a name="line.1563"></a>
- <span class="sourceLineNo">1564</span> public void setRenderer(XYItemRenderer renderer) {<a name="line.1564"></a>
- <span class="sourceLineNo">1565</span> setRenderer(0, renderer);<a name="line.1565"></a>
- <span class="sourceLineNo">1566</span> }<a name="line.1566"></a>
- <span class="sourceLineNo">1567</span><a name="line.1567"></a>
- <span class="sourceLineNo">1568</span> /**<a name="line.1568"></a>
- <span class="sourceLineNo">1569</span> * Sets the renderer for the dataset with the specified index and sends a <a name="line.1569"></a>
- <span class="sourceLineNo">1570</span> * change event to all registered listeners. Note that each dataset should <a name="line.1570"></a>
- <span class="sourceLineNo">1571</span> * have its own renderer, you should not use one renderer for multiple <a name="line.1571"></a>
- <span class="sourceLineNo">1572</span> * datasets.<a name="line.1572"></a>
- <span class="sourceLineNo">1573</span> *<a name="line.1573"></a>
- <span class="sourceLineNo">1574</span> * @param index the index (must be &gt;= 0).<a name="line.1574"></a>
- <span class="sourceLineNo">1575</span> * @param renderer the renderer.<a name="line.1575"></a>
- <span class="sourceLineNo">1576</span> *<a name="line.1576"></a>
- <span class="sourceLineNo">1577</span> * @see #getRenderer(int)<a name="line.1577"></a>
- <span class="sourceLineNo">1578</span> */<a name="line.1578"></a>
- <span class="sourceLineNo">1579</span> public void setRenderer(int index, XYItemRenderer renderer) {<a name="line.1579"></a>
- <span class="sourceLineNo">1580</span> setRenderer(index, renderer, true);<a name="line.1580"></a>
- <span class="sourceLineNo">1581</span> }<a name="line.1581"></a>
- <span class="sourceLineNo">1582</span><a name="line.1582"></a>
- <span class="sourceLineNo">1583</span> /**<a name="line.1583"></a>
- <span class="sourceLineNo">1584</span> * Sets the renderer for the dataset with the specified index and, if <a name="line.1584"></a>
- <span class="sourceLineNo">1585</span> * requested, sends a change event to all registered listeners. Note that <a name="line.1585"></a>
- <span class="sourceLineNo">1586</span> * each dataset should have its own renderer, you should not use one <a name="line.1586"></a>
- <span class="sourceLineNo">1587</span> * renderer for multiple datasets.<a name="line.1587"></a>
- <span class="sourceLineNo">1588</span> *<a name="line.1588"></a>
- <span class="sourceLineNo">1589</span> * @param index the index (must be &gt;= 0).<a name="line.1589"></a>
- <span class="sourceLineNo">1590</span> * @param renderer the renderer.<a name="line.1590"></a>
- <span class="sourceLineNo">1591</span> * @param notify notify listeners?<a name="line.1591"></a>
- <span class="sourceLineNo">1592</span> *<a name="line.1592"></a>
- <span class="sourceLineNo">1593</span> * @see #getRenderer(int)<a name="line.1593"></a>
- <span class="sourceLineNo">1594</span> */<a name="line.1594"></a>
- <span class="sourceLineNo">1595</span> public void setRenderer(int index, XYItemRenderer renderer, <a name="line.1595"></a>
- <span class="sourceLineNo">1596</span> boolean notify) {<a name="line.1596"></a>
- <span class="sourceLineNo">1597</span> XYItemRenderer existing = getRenderer(index);<a name="line.1597"></a>
- <span class="sourceLineNo">1598</span> if (existing != null) {<a name="line.1598"></a>
- <span class="sourceLineNo">1599</span> existing.removeChangeListener(this);<a name="line.1599"></a>
- <span class="sourceLineNo">1600</span> }<a name="line.1600"></a>
- <span class="sourceLineNo">1601</span> this.renderers.put(index, renderer);<a name="line.1601"></a>
- <span class="sourceLineNo">1602</span> if (renderer != null) {<a name="line.1602"></a>
- <span class="sourceLineNo">1603</span> renderer.setPlot(this);<a name="line.1603"></a>
- <span class="sourceLineNo">1604</span> renderer.addChangeListener(this);<a name="line.1604"></a>
- <span class="sourceLineNo">1605</span> }<a name="line.1605"></a>
- <span class="sourceLineNo">1606</span> configureDomainAxes();<a name="line.1606"></a>
- <span class="sourceLineNo">1607</span> configureRangeAxes();<a name="line.1607"></a>
- <span class="sourceLineNo">1608</span> if (notify) {<a name="line.1608"></a>
- <span class="sourceLineNo">1609</span> fireChangeEvent();<a name="line.1609"></a>
- <span class="sourceLineNo">1610</span> }<a name="line.1610"></a>
- <span class="sourceLineNo">1611</span> }<a name="line.1611"></a>
- <span class="sourceLineNo">1612</span><a name="line.1612"></a>
- <span class="sourceLineNo">1613</span> /**<a name="line.1613"></a>
- <span class="sourceLineNo">1614</span> * Sets the renderers for this plot and sends a {@link PlotChangeEvent}<a name="line.1614"></a>
- <span class="sourceLineNo">1615</span> * to all registered listeners.<a name="line.1615"></a>
- <span class="sourceLineNo">1616</span> *<a name="line.1616"></a>
- <span class="sourceLineNo">1617</span> * @param renderers the renderers (<code>null</code> not permitted).<a name="line.1617"></a>
- <span class="sourceLineNo">1618</span> */<a name="line.1618"></a>
- <span class="sourceLineNo">1619</span> public void setRenderers(XYItemRenderer[] renderers) {<a name="line.1619"></a>
- <span class="sourceLineNo">1620</span> for (int i = 0; i < renderers.length; i++) {<a name="line.1620"></a>
- <span class="sourceLineNo">1621</span> setRenderer(i, renderers[i], false);<a name="line.1621"></a>
- <span class="sourceLineNo">1622</span> }<a name="line.1622"></a>
- <span class="sourceLineNo">1623</span> fireChangeEvent();<a name="line.1623"></a>
- <span class="sourceLineNo">1624</span> }<a name="line.1624"></a>
- <span class="sourceLineNo">1625</span><a name="line.1625"></a>
- <span class="sourceLineNo">1626</span> /**<a name="line.1626"></a>
- <span class="sourceLineNo">1627</span> * Returns the dataset rendering order.<a name="line.1627"></a>
- <span class="sourceLineNo">1628</span> *<a name="line.1628"></a>
- <span class="sourceLineNo">1629</span> * @return The order (never <code>null</code>).<a name="line.1629"></a>
- <span class="sourceLineNo">1630</span> *<a name="line.1630"></a>
- <span class="sourceLineNo">1631</span> * @see #setDatasetRenderingOrder(DatasetRenderingOrder)<a name="line.1631"></a>
- <span class="sourceLineNo">1632</span> */<a name="line.1632"></a>
- <span class="sourceLineNo">1633</span> public DatasetRenderingOrder getDatasetRenderingOrder() {<a name="line.1633"></a>
- <span class="sourceLineNo">1634</span> return this.datasetRenderingOrder;<a name="line.1634"></a>
- <span class="sourceLineNo">1635</span> }<a name="line.1635"></a>
- <span class="sourceLineNo">1636</span><a name="line.1636"></a>
- <span class="sourceLineNo">1637</span> /**<a name="line.1637"></a>
- <span class="sourceLineNo">1638</span> * Sets the rendering order and sends a {@link PlotChangeEvent} to all<a name="line.1638"></a>
- <span class="sourceLineNo">1639</span> * registered listeners. By default, the plot renders the primary dataset<a name="line.1639"></a>
- <span class="sourceLineNo">1640</span> * last (so that the primary dataset overlays the secondary datasets).<a name="line.1640"></a>
- <span class="sourceLineNo">1641</span> * You can reverse this if you want to.<a name="line.1641"></a>
- <span class="sourceLineNo">1642</span> *<a name="line.1642"></a>
- <span class="sourceLineNo">1643</span> * @param order the rendering order (<code>null</code> not permitted).<a name="line.1643"></a>
- <span class="sourceLineNo">1644</span> *<a name="line.1644"></a>
- <span class="sourceLineNo">1645</span> * @see #getDatasetRenderingOrder()<a name="line.1645"></a>
- <span class="sourceLineNo">1646</span> */<a name="line.1646"></a>
- <span class="sourceLineNo">1647</span> public void setDatasetRenderingOrder(DatasetRenderingOrder order) {<a name="line.1647"></a>
- <span class="sourceLineNo">1648</span> ParamChecks.nullNotPermitted(order, "order");<a name="line.1648"></a>
- <span class="sourceLineNo">1649</span> this.datasetRenderingOrder = order;<a name="line.1649"></a>
- <span class="sourceLineNo">1650</span> fireChangeEvent();<a name="line.1650"></a>
- <span class="sourceLineNo">1651</span> }<a name="line.1651"></a>
- <span class="sourceLineNo">1652</span><a name="line.1652"></a>
- <span class="sourceLineNo">1653</span> /**<a name="line.1653"></a>
- <span class="sourceLineNo">1654</span> * Returns the series rendering order.<a name="line.1654"></a>
- <span class="sourceLineNo">1655</span> *<a name="line.1655"></a>
- <span class="sourceLineNo">1656</span> * @return the order (never <code>null</code>).<a name="line.1656"></a>
- <span class="sourceLineNo">1657</span> *<a name="line.1657"></a>
- <span class="sourceLineNo">1658</span> * @see #setSeriesRenderingOrder(SeriesRenderingOrder)<a name="line.1658"></a>
- <span class="sourceLineNo">1659</span> */<a name="line.1659"></a>
- <span class="sourceLineNo">1660</span> public SeriesRenderingOrder getSeriesRenderingOrder() {<a name="line.1660"></a>
- <span class="sourceLineNo">1661</span> return this.seriesRenderingOrder;<a name="line.1661"></a>
- <span class="sourceLineNo">1662</span> }<a name="line.1662"></a>
- <span class="sourceLineNo">1663</span><a name="line.1663"></a>
- <span class="sourceLineNo">1664</span> /**<a name="line.1664"></a>
- <span class="sourceLineNo">1665</span> * Sets the series order and sends a {@link PlotChangeEvent} to all<a name="line.1665"></a>
- <span class="sourceLineNo">1666</span> * registered listeners. By default, the plot renders the primary series<a name="line.1666"></a>
- <span class="sourceLineNo">1667</span> * last (so that the primary series appears to be on top).<a name="line.1667"></a>
- <span class="sourceLineNo">1668</span> * You can reverse this if you want to.<a name="line.1668"></a>
- <span class="sourceLineNo">1669</span> *<a name="line.1669"></a>
- <span class="sourceLineNo">1670</span> * @param order the rendering order (<code>null</code> not permitted).<a name="line.1670"></a>
- <span class="sourceLineNo">1671</span> *<a name="line.1671"></a>
- <span class="sourceLineNo">1672</span> * @see #getSeriesRenderingOrder()<a name="line.1672"></a>
- <span class="sourceLineNo">1673</span> */<a name="line.1673"></a>
- <span class="sourceLineNo">1674</span> public void setSeriesRenderingOrder(SeriesRenderingOrder order) {<a name="line.1674"></a>
- <span class="sourceLineNo">1675</span> ParamChecks.nullNotPermitted(order, "order");<a name="line.1675"></a>
- <span class="sourceLineNo">1676</span> this.seriesRenderingOrder = order;<a name="line.1676"></a>
- <span class="sourceLineNo">1677</span> fireChangeEvent();<a name="line.1677"></a>
- <span class="sourceLineNo">1678</span> }<a name="line.1678"></a>
- <span class="sourceLineNo">1679</span><a name="line.1679"></a>
- <span class="sourceLineNo">1680</span> /**<a name="line.1680"></a>
- <span class="sourceLineNo">1681</span> * Returns the index of the specified renderer, or <code>-1</code> if the<a name="line.1681"></a>
- <span class="sourceLineNo">1682</span> * renderer is not assigned to this plot.<a name="line.1682"></a>
- <span class="sourceLineNo">1683</span> *<a name="line.1683"></a>
- <span class="sourceLineNo">1684</span> * @param renderer the renderer (<code>null</code> permitted).<a name="line.1684"></a>
- <span class="sourceLineNo">1685</span> *<a name="line.1685"></a>
- <span class="sourceLineNo">1686</span> * @return The renderer index.<a name="line.1686"></a>
- <span class="sourceLineNo">1687</span> */<a name="line.1687"></a>
- <span class="sourceLineNo">1688</span> public int getIndexOf(XYItemRenderer renderer) {<a name="line.1688"></a>
- <span class="sourceLineNo">1689</span> for (Map.Entry<Integer, XYItemRenderer> entry <a name="line.1689"></a>
- <span class="sourceLineNo">1690</span> : this.renderers.entrySet()) {<a name="line.1690"></a>
- <span class="sourceLineNo">1691</span> if (entry.getValue() == renderer) {<a name="line.1691"></a>
- <span class="sourceLineNo">1692</span> return entry.getKey();<a name="line.1692"></a>
- <span class="sourceLineNo">1693</span> }<a name="line.1693"></a>
- <span class="sourceLineNo">1694</span> }<a name="line.1694"></a>
- <span class="sourceLineNo">1695</span> return -1;<a name="line.1695"></a>
- <span class="sourceLineNo">1696</span> }<a name="line.1696"></a>
- <span class="sourceLineNo">1697</span><a name="line.1697"></a>
- <span class="sourceLineNo">1698</span> /**<a name="line.1698"></a>
- <span class="sourceLineNo">1699</span> * Returns the renderer for the specified dataset (this is either the<a name="line.1699"></a>
- <span class="sourceLineNo">1700</span> * renderer with the same index as the dataset or, if there isn't a <a name="line.1700"></a>
- <span class="sourceLineNo">1701</span> * renderer with the same index, the default renderer). If the dataset<a name="line.1701"></a>
- <span class="sourceLineNo">1702</span> * does not belong to the plot, this method will return {@code null}.<a name="line.1702"></a>
- <span class="sourceLineNo">1703</span> *<a name="line.1703"></a>
- <span class="sourceLineNo">1704</span> * @param dataset the dataset ({@code null} permitted).<a name="line.1704"></a>
- <span class="sourceLineNo">1705</span> *<a name="line.1705"></a>
- <span class="sourceLineNo">1706</span> * @return The renderer (possibly {@code null}).<a name="line.1706"></a>
- <span class="sourceLineNo">1707</span> */<a name="line.1707"></a>
- <span class="sourceLineNo">1708</span> public XYItemRenderer getRendererForDataset(XYDataset dataset) {<a name="line.1708"></a>
- <span class="sourceLineNo">1709</span> int datasetIndex = indexOf(dataset);<a name="line.1709"></a>
- <span class="sourceLineNo">1710</span> if (datasetIndex < 0) {<a name="line.1710"></a>
- <span class="sourceLineNo">1711</span> return null;<a name="line.1711"></a>
- <span class="sourceLineNo">1712</span> } <a name="line.1712"></a>
- <span class="sourceLineNo">1713</span> XYItemRenderer result = this.renderers.get(datasetIndex);<a name="line.1713"></a>
- <span class="sourceLineNo">1714</span> if (result == null) {<a name="line.1714"></a>
- <span class="sourceLineNo">1715</span> result = getRenderer();<a name="line.1715"></a>
- <span class="sourceLineNo">1716</span> }<a name="line.1716"></a>
- <span class="sourceLineNo">1717</span> return result;<a name="line.1717"></a>
- <span class="sourceLineNo">1718</span> }<a name="line.1718"></a>
- <span class="sourceLineNo">1719</span><a name="line.1719"></a>
- <span class="sourceLineNo">1720</span> /**<a name="line.1720"></a>
- <span class="sourceLineNo">1721</span> * Returns the weight for this plot when it is used as a subplot within a<a name="line.1721"></a>
- <span class="sourceLineNo">1722</span> * combined plot.<a name="line.1722"></a>
- <span class="sourceLineNo">1723</span> *<a name="line.1723"></a>
- <span class="sourceLineNo">1724</span> * @return The weight.<a name="line.1724"></a>
- <span class="sourceLineNo">1725</span> *<a name="line.1725"></a>
- <span class="sourceLineNo">1726</span> * @see #setWeight(int)<a name="line.1726"></a>
- <span class="sourceLineNo">1727</span> */<a name="line.1727"></a>
- <span class="sourceLineNo">1728</span> public int getWeight() {<a name="line.1728"></a>
- <span class="sourceLineNo">1729</span> return this.weight;<a name="line.1729"></a>
- <span class="sourceLineNo">1730</span> }<a name="line.1730"></a>
- <span class="sourceLineNo">1731</span><a name="line.1731"></a>
- <span class="sourceLineNo">1732</span> /**<a name="line.1732"></a>
- <span class="sourceLineNo">1733</span> * Sets the weight for the plot and sends a {@link PlotChangeEvent} to all<a name="line.1733"></a>
- <span class="sourceLineNo">1734</span> * registered listeners.<a name="line.1734"></a>
- <span class="sourceLineNo">1735</span> *<a name="line.1735"></a>
- <span class="sourceLineNo">1736</span> * @param weight the weight.<a name="line.1736"></a>
- <span class="sourceLineNo">1737</span> *<a name="line.1737"></a>
- <span class="sourceLineNo">1738</span> * @see #getWeight()<a name="line.1738"></a>
- <span class="sourceLineNo">1739</span> */<a name="line.1739"></a>
- <span class="sourceLineNo">1740</span> public void setWeight(int weight) {<a name="line.1740"></a>
- <span class="sourceLineNo">1741</span> this.weight = weight;<a name="line.1741"></a>
- <span class="sourceLineNo">1742</span> fireChangeEvent();<a name="line.1742"></a>
- <span class="sourceLineNo">1743</span> }<a name="line.1743"></a>
- <span class="sourceLineNo">1744</span><a name="line.1744"></a>
- <span class="sourceLineNo">1745</span> /**<a name="line.1745"></a>
- <span class="sourceLineNo">1746</span> * Returns <code>true</code> if the domain gridlines are visible, and<a name="line.1746"></a>
- <span class="sourceLineNo">1747</span> * <code>false</code> otherwise.<a name="line.1747"></a>
- <span class="sourceLineNo">1748</span> *<a name="line.1748"></a>
- <span class="sourceLineNo">1749</span> * @return <code>true</code> or <code>false</code>.<a name="line.1749"></a>
- <span class="sourceLineNo">1750</span> *<a name="line.1750"></a>
- <span class="sourceLineNo">1751</span> * @see #setDomainGridlinesVisible(boolean)<a name="line.1751"></a>
- <span class="sourceLineNo">1752</span> */<a name="line.1752"></a>
- <span class="sourceLineNo">1753</span> public boolean isDomainGridlinesVisible() {<a name="line.1753"></a>
- <span class="sourceLineNo">1754</span> return this.domainGridlinesVisible;<a name="line.1754"></a>
- <span class="sourceLineNo">1755</span> }<a name="line.1755"></a>
- <span class="sourceLineNo">1756</span><a name="line.1756"></a>
- <span class="sourceLineNo">1757</span> /**<a name="line.1757"></a>
- <span class="sourceLineNo">1758</span> * Sets the flag that controls whether or not the domain grid-lines are<a name="line.1758"></a>
- <span class="sourceLineNo">1759</span> * visible.<a name="line.1759"></a>
- <span class="sourceLineNo">1760</span> * <p><a name="line.1760"></a>
- <span class="sourceLineNo">1761</span> * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.1761"></a>
- <span class="sourceLineNo">1762</span> * registered listeners.<a name="line.1762"></a>
- <span class="sourceLineNo">1763</span> *<a name="line.1763"></a>
- <span class="sourceLineNo">1764</span> * @param visible the new value of the flag.<a name="line.1764"></a>
- <span class="sourceLineNo">1765</span> *<a name="line.1765"></a>
- <span class="sourceLineNo">1766</span> * @see #isDomainGridlinesVisible()<a name="line.1766"></a>
- <span class="sourceLineNo">1767</span> */<a name="line.1767"></a>
- <span class="sourceLineNo">1768</span> public void setDomainGridlinesVisible(boolean visible) {<a name="line.1768"></a>
- <span class="sourceLineNo">1769</span> if (this.domainGridlinesVisible != visible) {<a name="line.1769"></a>
- <span class="sourceLineNo">1770</span> this.domainGridlinesVisible = visible;<a name="line.1770"></a>
- <span class="sourceLineNo">1771</span> fireChangeEvent();<a name="line.1771"></a>
- <span class="sourceLineNo">1772</span> }<a name="line.1772"></a>
- <span class="sourceLineNo">1773</span> }<a name="line.1773"></a>
- <span class="sourceLineNo">1774</span><a name="line.1774"></a>
- <span class="sourceLineNo">1775</span> /**<a name="line.1775"></a>
- <span class="sourceLineNo">1776</span> * Returns <code>true</code> if the domain minor gridlines are visible, and<a name="line.1776"></a>
- <span class="sourceLineNo">1777</span> * <code>false</code> otherwise.<a name="line.1777"></a>
- <span class="sourceLineNo">1778</span> *<a name="line.1778"></a>
- <span class="sourceLineNo">1779</span> * @return <code>true</code> or <code>false</code>.<a name="line.1779"></a>
- <span class="sourceLineNo">1780</span> *<a name="line.1780"></a>
- <span class="sourceLineNo">1781</span> * @see #setDomainMinorGridlinesVisible(boolean)<a name="line.1781"></a>
- <span class="sourceLineNo">1782</span> *<a name="line.1782"></a>
- <span class="sourceLineNo">1783</span> * @since 1.0.12<a name="line.1783"></a>
- <span class="sourceLineNo">1784</span> */<a name="line.1784"></a>
- <span class="sourceLineNo">1785</span> public boolean isDomainMinorGridlinesVisible() {<a name="line.1785"></a>
- <span class="sourceLineNo">1786</span> return this.domainMinorGridlinesVisible;<a name="line.1786"></a>
- <span class="sourceLineNo">1787</span> }<a name="line.1787"></a>
- <span class="sourceLineNo">1788</span><a name="line.1788"></a>
- <span class="sourceLineNo">1789</span> /**<a name="line.1789"></a>
- <span class="sourceLineNo">1790</span> * Sets the flag that controls whether or not the domain minor grid-lines<a name="line.1790"></a>
- <span class="sourceLineNo">1791</span> * are visible.<a name="line.1791"></a>
- <span class="sourceLineNo">1792</span> * <p><a name="line.1792"></a>
- <span class="sourceLineNo">1793</span> * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.1793"></a>
- <span class="sourceLineNo">1794</span> * registered listeners.<a name="line.1794"></a>
- <span class="sourceLineNo">1795</span> *<a name="line.1795"></a>
- <span class="sourceLineNo">1796</span> * @param visible the new value of the flag.<a name="line.1796"></a>
- <span class="sourceLineNo">1797</span> *<a name="line.1797"></a>
- <span class="sourceLineNo">1798</span> * @see #isDomainMinorGridlinesVisible()<a name="line.1798"></a>
- <span class="sourceLineNo">1799</span> *<a name="line.1799"></a>
- <span class="sourceLineNo">1800</span> * @since 1.0.12<a name="line.1800"></a>
- <span class="sourceLineNo">1801</span> */<a name="line.1801"></a>
- <span class="sourceLineNo">1802</span> public void setDomainMinorGridlinesVisible(boolean visible) {<a name="line.1802"></a>
- <span class="sourceLineNo">1803</span> if (this.domainMinorGridlinesVisible != visible) {<a name="line.1803"></a>
- <span class="sourceLineNo">1804</span> this.domainMinorGridlinesVisible = visible;<a name="line.1804"></a>
- <span class="sourceLineNo">1805</span> fireChangeEvent();<a name="line.1805"></a>
- <span class="sourceLineNo">1806</span> }<a name="line.1806"></a>
- <span class="sourceLineNo">1807</span> }<a name="line.1807"></a>
- <span class="sourceLineNo">1808</span><a name="line.1808"></a>
- <span class="sourceLineNo">1809</span> /**<a name="line.1809"></a>
- <span class="sourceLineNo">1810</span> * Returns the stroke for the grid-lines (if any) plotted against the<a name="line.1810"></a>
- <span class="sourceLineNo">1811</span> * domain axis.<a name="line.1811"></a>
- <span class="sourceLineNo">1812</span> *<a name="line.1812"></a>
- <span class="sourceLineNo">1813</span> * @return The stroke (never <code>null</code>).<a name="line.1813"></a>
- <span class="sourceLineNo">1814</span> *<a name="line.1814"></a>
- <span class="sourceLineNo">1815</span> * @see #setDomainGridlineStroke(Stroke)<a name="line.1815"></a>
- <span class="sourceLineNo">1816</span> */<a name="line.1816"></a>
- <span class="sourceLineNo">1817</span> public Stroke getDomainGridlineStroke() {<a name="line.1817"></a>
- <span class="sourceLineNo">1818</span> return this.domainGridlineStroke;<a name="line.1818"></a>
- <span class="sourceLineNo">1819</span> }<a name="line.1819"></a>
- <span class="sourceLineNo">1820</span><a name="line.1820"></a>
- <span class="sourceLineNo">1821</span> /**<a name="line.1821"></a>
- <span class="sourceLineNo">1822</span> * Sets the stroke for the grid lines plotted against the domain axis, and<a name="line.1822"></a>
- <span class="sourceLineNo">1823</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1823"></a>
- <span class="sourceLineNo">1824</span> *<a name="line.1824"></a>
- <span class="sourceLineNo">1825</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.1825"></a>
- <span class="sourceLineNo">1826</span> *<a name="line.1826"></a>
- <span class="sourceLineNo">1827</span> * @throws IllegalArgumentException if <code>stroke</code> is<a name="line.1827"></a>
- <span class="sourceLineNo">1828</span> * <code>null</code>.<a name="line.1828"></a>
- <span class="sourceLineNo">1829</span> *<a name="line.1829"></a>
- <span class="sourceLineNo">1830</span> * @see #getDomainGridlineStroke()<a name="line.1830"></a>
- <span class="sourceLineNo">1831</span> */<a name="line.1831"></a>
- <span class="sourceLineNo">1832</span> public void setDomainGridlineStroke(Stroke stroke) {<a name="line.1832"></a>
- <span class="sourceLineNo">1833</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.1833"></a>
- <span class="sourceLineNo">1834</span> this.domainGridlineStroke = stroke;<a name="line.1834"></a>
- <span class="sourceLineNo">1835</span> fireChangeEvent();<a name="line.1835"></a>
- <span class="sourceLineNo">1836</span> }<a name="line.1836"></a>
- <span class="sourceLineNo">1837</span><a name="line.1837"></a>
- <span class="sourceLineNo">1838</span> /**<a name="line.1838"></a>
- <span class="sourceLineNo">1839</span> * Returns the stroke for the minor grid-lines (if any) plotted against the<a name="line.1839"></a>
- <span class="sourceLineNo">1840</span> * domain axis.<a name="line.1840"></a>
- <span class="sourceLineNo">1841</span> *<a name="line.1841"></a>
- <span class="sourceLineNo">1842</span> * @return The stroke (never <code>null</code>).<a name="line.1842"></a>
- <span class="sourceLineNo">1843</span> *<a name="line.1843"></a>
- <span class="sourceLineNo">1844</span> * @see #setDomainMinorGridlineStroke(Stroke)<a name="line.1844"></a>
- <span class="sourceLineNo">1845</span> *<a name="line.1845"></a>
- <span class="sourceLineNo">1846</span> * @since 1.0.12<a name="line.1846"></a>
- <span class="sourceLineNo">1847</span> */<a name="line.1847"></a>
- <span class="sourceLineNo">1848</span><a name="line.1848"></a>
- <span class="sourceLineNo">1849</span> public Stroke getDomainMinorGridlineStroke() {<a name="line.1849"></a>
- <span class="sourceLineNo">1850</span> return this.domainMinorGridlineStroke;<a name="line.1850"></a>
- <span class="sourceLineNo">1851</span> }<a name="line.1851"></a>
- <span class="sourceLineNo">1852</span><a name="line.1852"></a>
- <span class="sourceLineNo">1853</span> /**<a name="line.1853"></a>
- <span class="sourceLineNo">1854</span> * Sets the stroke for the minor grid lines plotted against the domain<a name="line.1854"></a>
- <span class="sourceLineNo">1855</span> * axis, and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1855"></a>
- <span class="sourceLineNo">1856</span> *<a name="line.1856"></a>
- <span class="sourceLineNo">1857</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.1857"></a>
- <span class="sourceLineNo">1858</span> *<a name="line.1858"></a>
- <span class="sourceLineNo">1859</span> * @throws IllegalArgumentException if <code>stroke</code> is<a name="line.1859"></a>
- <span class="sourceLineNo">1860</span> * <code>null</code>.<a name="line.1860"></a>
- <span class="sourceLineNo">1861</span> *<a name="line.1861"></a>
- <span class="sourceLineNo">1862</span> * @see #getDomainMinorGridlineStroke()<a name="line.1862"></a>
- <span class="sourceLineNo">1863</span> *<a name="line.1863"></a>
- <span class="sourceLineNo">1864</span> * @since 1.0.12<a name="line.1864"></a>
- <span class="sourceLineNo">1865</span> */<a name="line.1865"></a>
- <span class="sourceLineNo">1866</span> public void setDomainMinorGridlineStroke(Stroke stroke) {<a name="line.1866"></a>
- <span class="sourceLineNo">1867</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.1867"></a>
- <span class="sourceLineNo">1868</span> this.domainMinorGridlineStroke = stroke;<a name="line.1868"></a>
- <span class="sourceLineNo">1869</span> fireChangeEvent();<a name="line.1869"></a>
- <span class="sourceLineNo">1870</span> }<a name="line.1870"></a>
- <span class="sourceLineNo">1871</span><a name="line.1871"></a>
- <span class="sourceLineNo">1872</span> /**<a name="line.1872"></a>
- <span class="sourceLineNo">1873</span> * Returns the paint for the grid lines (if any) plotted against the domain<a name="line.1873"></a>
- <span class="sourceLineNo">1874</span> * axis.<a name="line.1874"></a>
- <span class="sourceLineNo">1875</span> *<a name="line.1875"></a>
- <span class="sourceLineNo">1876</span> * @return The paint (never <code>null</code>).<a name="line.1876"></a>
- <span class="sourceLineNo">1877</span> *<a name="line.1877"></a>
- <span class="sourceLineNo">1878</span> * @see #setDomainGridlinePaint(Paint)<a name="line.1878"></a>
- <span class="sourceLineNo">1879</span> */<a name="line.1879"></a>
- <span class="sourceLineNo">1880</span> public Paint getDomainGridlinePaint() {<a name="line.1880"></a>
- <span class="sourceLineNo">1881</span> return this.domainGridlinePaint;<a name="line.1881"></a>
- <span class="sourceLineNo">1882</span> }<a name="line.1882"></a>
- <span class="sourceLineNo">1883</span><a name="line.1883"></a>
- <span class="sourceLineNo">1884</span> /**<a name="line.1884"></a>
- <span class="sourceLineNo">1885</span> * Sets the paint for the grid lines plotted against the domain axis, and<a name="line.1885"></a>
- <span class="sourceLineNo">1886</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1886"></a>
- <span class="sourceLineNo">1887</span> *<a name="line.1887"></a>
- <span class="sourceLineNo">1888</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.1888"></a>
- <span class="sourceLineNo">1889</span> *<a name="line.1889"></a>
- <span class="sourceLineNo">1890</span> * @throws IllegalArgumentException if <code>paint</code> is<a name="line.1890"></a>
- <span class="sourceLineNo">1891</span> * <code>null</code>.<a name="line.1891"></a>
- <span class="sourceLineNo">1892</span> *<a name="line.1892"></a>
- <span class="sourceLineNo">1893</span> * @see #getDomainGridlinePaint()<a name="line.1893"></a>
- <span class="sourceLineNo">1894</span> */<a name="line.1894"></a>
- <span class="sourceLineNo">1895</span> public void setDomainGridlinePaint(Paint paint) {<a name="line.1895"></a>
- <span class="sourceLineNo">1896</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.1896"></a>
- <span class="sourceLineNo">1897</span> this.domainGridlinePaint = paint;<a name="line.1897"></a>
- <span class="sourceLineNo">1898</span> fireChangeEvent();<a name="line.1898"></a>
- <span class="sourceLineNo">1899</span> }<a name="line.1899"></a>
- <span class="sourceLineNo">1900</span><a name="line.1900"></a>
- <span class="sourceLineNo">1901</span> /**<a name="line.1901"></a>
- <span class="sourceLineNo">1902</span> * Returns the paint for the minor grid lines (if any) plotted against the<a name="line.1902"></a>
- <span class="sourceLineNo">1903</span> * domain axis.<a name="line.1903"></a>
- <span class="sourceLineNo">1904</span> *<a name="line.1904"></a>
- <span class="sourceLineNo">1905</span> * @return The paint (never <code>null</code>).<a name="line.1905"></a>
- <span class="sourceLineNo">1906</span> *<a name="line.1906"></a>
- <span class="sourceLineNo">1907</span> * @see #setDomainMinorGridlinePaint(Paint)<a name="line.1907"></a>
- <span class="sourceLineNo">1908</span> *<a name="line.1908"></a>
- <span class="sourceLineNo">1909</span> * @since 1.0.12<a name="line.1909"></a>
- <span class="sourceLineNo">1910</span> */<a name="line.1910"></a>
- <span class="sourceLineNo">1911</span> public Paint getDomainMinorGridlinePaint() {<a name="line.1911"></a>
- <span class="sourceLineNo">1912</span> return this.domainMinorGridlinePaint;<a name="line.1912"></a>
- <span class="sourceLineNo">1913</span> }<a name="line.1913"></a>
- <span class="sourceLineNo">1914</span><a name="line.1914"></a>
- <span class="sourceLineNo">1915</span> /**<a name="line.1915"></a>
- <span class="sourceLineNo">1916</span> * Sets the paint for the minor grid lines plotted against the domain axis,<a name="line.1916"></a>
- <span class="sourceLineNo">1917</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1917"></a>
- <span class="sourceLineNo">1918</span> *<a name="line.1918"></a>
- <span class="sourceLineNo">1919</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.1919"></a>
- <span class="sourceLineNo">1920</span> *<a name="line.1920"></a>
- <span class="sourceLineNo">1921</span> * @throws IllegalArgumentException if <code>paint</code> is<a name="line.1921"></a>
- <span class="sourceLineNo">1922</span> * <code>null</code>.<a name="line.1922"></a>
- <span class="sourceLineNo">1923</span> *<a name="line.1923"></a>
- <span class="sourceLineNo">1924</span> * @see #getDomainMinorGridlinePaint()<a name="line.1924"></a>
- <span class="sourceLineNo">1925</span> *<a name="line.1925"></a>
- <span class="sourceLineNo">1926</span> * @since 1.0.12<a name="line.1926"></a>
- <span class="sourceLineNo">1927</span> */<a name="line.1927"></a>
- <span class="sourceLineNo">1928</span> public void setDomainMinorGridlinePaint(Paint paint) {<a name="line.1928"></a>
- <span class="sourceLineNo">1929</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.1929"></a>
- <span class="sourceLineNo">1930</span> this.domainMinorGridlinePaint = paint;<a name="line.1930"></a>
- <span class="sourceLineNo">1931</span> fireChangeEvent();<a name="line.1931"></a>
- <span class="sourceLineNo">1932</span> }<a name="line.1932"></a>
- <span class="sourceLineNo">1933</span><a name="line.1933"></a>
- <span class="sourceLineNo">1934</span> /**<a name="line.1934"></a>
- <span class="sourceLineNo">1935</span> * Returns <code>true</code> if the range axis grid is visible, and<a name="line.1935"></a>
- <span class="sourceLineNo">1936</span> * <code>false</code> otherwise.<a name="line.1936"></a>
- <span class="sourceLineNo">1937</span> *<a name="line.1937"></a>
- <span class="sourceLineNo">1938</span> * @return A boolean.<a name="line.1938"></a>
- <span class="sourceLineNo">1939</span> *<a name="line.1939"></a>
- <span class="sourceLineNo">1940</span> * @see #setRangeGridlinesVisible(boolean)<a name="line.1940"></a>
- <span class="sourceLineNo">1941</span> */<a name="line.1941"></a>
- <span class="sourceLineNo">1942</span> public boolean isRangeGridlinesVisible() {<a name="line.1942"></a>
- <span class="sourceLineNo">1943</span> return this.rangeGridlinesVisible;<a name="line.1943"></a>
- <span class="sourceLineNo">1944</span> }<a name="line.1944"></a>
- <span class="sourceLineNo">1945</span><a name="line.1945"></a>
- <span class="sourceLineNo">1946</span> /**<a name="line.1946"></a>
- <span class="sourceLineNo">1947</span> * Sets the flag that controls whether or not the range axis grid lines<a name="line.1947"></a>
- <span class="sourceLineNo">1948</span> * are visible.<a name="line.1948"></a>
- <span class="sourceLineNo">1949</span> * <p><a name="line.1949"></a>
- <span class="sourceLineNo">1950</span> * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.1950"></a>
- <span class="sourceLineNo">1951</span> * registered listeners.<a name="line.1951"></a>
- <span class="sourceLineNo">1952</span> *<a name="line.1952"></a>
- <span class="sourceLineNo">1953</span> * @param visible the new value of the flag.<a name="line.1953"></a>
- <span class="sourceLineNo">1954</span> *<a name="line.1954"></a>
- <span class="sourceLineNo">1955</span> * @see #isRangeGridlinesVisible()<a name="line.1955"></a>
- <span class="sourceLineNo">1956</span> */<a name="line.1956"></a>
- <span class="sourceLineNo">1957</span> public void setRangeGridlinesVisible(boolean visible) {<a name="line.1957"></a>
- <span class="sourceLineNo">1958</span> if (this.rangeGridlinesVisible != visible) {<a name="line.1958"></a>
- <span class="sourceLineNo">1959</span> this.rangeGridlinesVisible = visible;<a name="line.1959"></a>
- <span class="sourceLineNo">1960</span> fireChangeEvent();<a name="line.1960"></a>
- <span class="sourceLineNo">1961</span> }<a name="line.1961"></a>
- <span class="sourceLineNo">1962</span> }<a name="line.1962"></a>
- <span class="sourceLineNo">1963</span><a name="line.1963"></a>
- <span class="sourceLineNo">1964</span> /**<a name="line.1964"></a>
- <span class="sourceLineNo">1965</span> * Returns the stroke for the grid lines (if any) plotted against the<a name="line.1965"></a>
- <span class="sourceLineNo">1966</span> * range axis.<a name="line.1966"></a>
- <span class="sourceLineNo">1967</span> *<a name="line.1967"></a>
- <span class="sourceLineNo">1968</span> * @return The stroke (never <code>null</code>).<a name="line.1968"></a>
- <span class="sourceLineNo">1969</span> *<a name="line.1969"></a>
- <span class="sourceLineNo">1970</span> * @see #setRangeGridlineStroke(Stroke)<a name="line.1970"></a>
- <span class="sourceLineNo">1971</span> */<a name="line.1971"></a>
- <span class="sourceLineNo">1972</span> public Stroke getRangeGridlineStroke() {<a name="line.1972"></a>
- <span class="sourceLineNo">1973</span> return this.rangeGridlineStroke;<a name="line.1973"></a>
- <span class="sourceLineNo">1974</span> }<a name="line.1974"></a>
- <span class="sourceLineNo">1975</span><a name="line.1975"></a>
- <span class="sourceLineNo">1976</span> /**<a name="line.1976"></a>
- <span class="sourceLineNo">1977</span> * Sets the stroke for the grid lines plotted against the range axis,<a name="line.1977"></a>
- <span class="sourceLineNo">1978</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1978"></a>
- <span class="sourceLineNo">1979</span> *<a name="line.1979"></a>
- <span class="sourceLineNo">1980</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.1980"></a>
- <span class="sourceLineNo">1981</span> *<a name="line.1981"></a>
- <span class="sourceLineNo">1982</span> * @see #getRangeGridlineStroke()<a name="line.1982"></a>
- <span class="sourceLineNo">1983</span> */<a name="line.1983"></a>
- <span class="sourceLineNo">1984</span> public void setRangeGridlineStroke(Stroke stroke) {<a name="line.1984"></a>
- <span class="sourceLineNo">1985</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.1985"></a>
- <span class="sourceLineNo">1986</span> this.rangeGridlineStroke = stroke;<a name="line.1986"></a>
- <span class="sourceLineNo">1987</span> fireChangeEvent();<a name="line.1987"></a>
- <span class="sourceLineNo">1988</span> }<a name="line.1988"></a>
- <span class="sourceLineNo">1989</span><a name="line.1989"></a>
- <span class="sourceLineNo">1990</span> /**<a name="line.1990"></a>
- <span class="sourceLineNo">1991</span> * Returns the paint for the grid lines (if any) plotted against the range<a name="line.1991"></a>
- <span class="sourceLineNo">1992</span> * axis.<a name="line.1992"></a>
- <span class="sourceLineNo">1993</span> *<a name="line.1993"></a>
- <span class="sourceLineNo">1994</span> * @return The paint (never <code>null</code>).<a name="line.1994"></a>
- <span class="sourceLineNo">1995</span> *<a name="line.1995"></a>
- <span class="sourceLineNo">1996</span> * @see #setRangeGridlinePaint(Paint)<a name="line.1996"></a>
- <span class="sourceLineNo">1997</span> */<a name="line.1997"></a>
- <span class="sourceLineNo">1998</span> public Paint getRangeGridlinePaint() {<a name="line.1998"></a>
- <span class="sourceLineNo">1999</span> return this.rangeGridlinePaint;<a name="line.1999"></a>
- <span class="sourceLineNo">2000</span> }<a name="line.2000"></a>
- <span class="sourceLineNo">2001</span><a name="line.2001"></a>
- <span class="sourceLineNo">2002</span> /**<a name="line.2002"></a>
- <span class="sourceLineNo">2003</span> * Sets the paint for the grid lines plotted against the range axis and<a name="line.2003"></a>
- <span class="sourceLineNo">2004</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2004"></a>
- <span class="sourceLineNo">2005</span> *<a name="line.2005"></a>
- <span class="sourceLineNo">2006</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.2006"></a>
- <span class="sourceLineNo">2007</span> *<a name="line.2007"></a>
- <span class="sourceLineNo">2008</span> * @see #getRangeGridlinePaint()<a name="line.2008"></a>
- <span class="sourceLineNo">2009</span> */<a name="line.2009"></a>
- <span class="sourceLineNo">2010</span> public void setRangeGridlinePaint(Paint paint) {<a name="line.2010"></a>
- <span class="sourceLineNo">2011</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.2011"></a>
- <span class="sourceLineNo">2012</span> this.rangeGridlinePaint = paint;<a name="line.2012"></a>
- <span class="sourceLineNo">2013</span> fireChangeEvent();<a name="line.2013"></a>
- <span class="sourceLineNo">2014</span> }<a name="line.2014"></a>
- <span class="sourceLineNo">2015</span><a name="line.2015"></a>
- <span class="sourceLineNo">2016</span> /**<a name="line.2016"></a>
- <span class="sourceLineNo">2017</span> * Returns <code>true</code> if the range axis minor grid is visible, and<a name="line.2017"></a>
- <span class="sourceLineNo">2018</span> * <code>false</code> otherwise.<a name="line.2018"></a>
- <span class="sourceLineNo">2019</span> *<a name="line.2019"></a>
- <span class="sourceLineNo">2020</span> * @return A boolean.<a name="line.2020"></a>
- <span class="sourceLineNo">2021</span> *<a name="line.2021"></a>
- <span class="sourceLineNo">2022</span> * @see #setRangeMinorGridlinesVisible(boolean)<a name="line.2022"></a>
- <span class="sourceLineNo">2023</span> *<a name="line.2023"></a>
- <span class="sourceLineNo">2024</span> * @since 1.0.12<a name="line.2024"></a>
- <span class="sourceLineNo">2025</span> */<a name="line.2025"></a>
- <span class="sourceLineNo">2026</span> public boolean isRangeMinorGridlinesVisible() {<a name="line.2026"></a>
- <span class="sourceLineNo">2027</span> return this.rangeMinorGridlinesVisible;<a name="line.2027"></a>
- <span class="sourceLineNo">2028</span> }<a name="line.2028"></a>
- <span class="sourceLineNo">2029</span><a name="line.2029"></a>
- <span class="sourceLineNo">2030</span> /**<a name="line.2030"></a>
- <span class="sourceLineNo">2031</span> * Sets the flag that controls whether or not the range axis minor grid<a name="line.2031"></a>
- <span class="sourceLineNo">2032</span> * lines are visible.<a name="line.2032"></a>
- <span class="sourceLineNo">2033</span> * <p><a name="line.2033"></a>
- <span class="sourceLineNo">2034</span> * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.2034"></a>
- <span class="sourceLineNo">2035</span> * registered listeners.<a name="line.2035"></a>
- <span class="sourceLineNo">2036</span> *<a name="line.2036"></a>
- <span class="sourceLineNo">2037</span> * @param visible the new value of the flag.<a name="line.2037"></a>
- <span class="sourceLineNo">2038</span> *<a name="line.2038"></a>
- <span class="sourceLineNo">2039</span> * @see #isRangeMinorGridlinesVisible()<a name="line.2039"></a>
- <span class="sourceLineNo">2040</span> *<a name="line.2040"></a>
- <span class="sourceLineNo">2041</span> * @since 1.0.12<a name="line.2041"></a>
- <span class="sourceLineNo">2042</span> */<a name="line.2042"></a>
- <span class="sourceLineNo">2043</span> public void setRangeMinorGridlinesVisible(boolean visible) {<a name="line.2043"></a>
- <span class="sourceLineNo">2044</span> if (this.rangeMinorGridlinesVisible != visible) {<a name="line.2044"></a>
- <span class="sourceLineNo">2045</span> this.rangeMinorGridlinesVisible = visible;<a name="line.2045"></a>
- <span class="sourceLineNo">2046</span> fireChangeEvent();<a name="line.2046"></a>
- <span class="sourceLineNo">2047</span> }<a name="line.2047"></a>
- <span class="sourceLineNo">2048</span> }<a name="line.2048"></a>
- <span class="sourceLineNo">2049</span><a name="line.2049"></a>
- <span class="sourceLineNo">2050</span> /**<a name="line.2050"></a>
- <span class="sourceLineNo">2051</span> * Returns the stroke for the minor grid lines (if any) plotted against the<a name="line.2051"></a>
- <span class="sourceLineNo">2052</span> * range axis.<a name="line.2052"></a>
- <span class="sourceLineNo">2053</span> *<a name="line.2053"></a>
- <span class="sourceLineNo">2054</span> * @return The stroke (never <code>null</code>).<a name="line.2054"></a>
- <span class="sourceLineNo">2055</span> *<a name="line.2055"></a>
- <span class="sourceLineNo">2056</span> * @see #setRangeMinorGridlineStroke(Stroke)<a name="line.2056"></a>
- <span class="sourceLineNo">2057</span> *<a name="line.2057"></a>
- <span class="sourceLineNo">2058</span> * @since 1.0.12<a name="line.2058"></a>
- <span class="sourceLineNo">2059</span> */<a name="line.2059"></a>
- <span class="sourceLineNo">2060</span> public Stroke getRangeMinorGridlineStroke() {<a name="line.2060"></a>
- <span class="sourceLineNo">2061</span> return this.rangeMinorGridlineStroke;<a name="line.2061"></a>
- <span class="sourceLineNo">2062</span> }<a name="line.2062"></a>
- <span class="sourceLineNo">2063</span><a name="line.2063"></a>
- <span class="sourceLineNo">2064</span> /**<a name="line.2064"></a>
- <span class="sourceLineNo">2065</span> * Sets the stroke for the minor grid lines plotted against the range axis,<a name="line.2065"></a>
- <span class="sourceLineNo">2066</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2066"></a>
- <span class="sourceLineNo">2067</span> *<a name="line.2067"></a>
- <span class="sourceLineNo">2068</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.2068"></a>
- <span class="sourceLineNo">2069</span> *<a name="line.2069"></a>
- <span class="sourceLineNo">2070</span> * @see #getRangeMinorGridlineStroke()<a name="line.2070"></a>
- <span class="sourceLineNo">2071</span> *<a name="line.2071"></a>
- <span class="sourceLineNo">2072</span> * @since 1.0.12<a name="line.2072"></a>
- <span class="sourceLineNo">2073</span> */<a name="line.2073"></a>
- <span class="sourceLineNo">2074</span> public void setRangeMinorGridlineStroke(Stroke stroke) {<a name="line.2074"></a>
- <span class="sourceLineNo">2075</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.2075"></a>
- <span class="sourceLineNo">2076</span> this.rangeMinorGridlineStroke = stroke;<a name="line.2076"></a>
- <span class="sourceLineNo">2077</span> fireChangeEvent();<a name="line.2077"></a>
- <span class="sourceLineNo">2078</span> }<a name="line.2078"></a>
- <span class="sourceLineNo">2079</span><a name="line.2079"></a>
- <span class="sourceLineNo">2080</span> /**<a name="line.2080"></a>
- <span class="sourceLineNo">2081</span> * Returns the paint for the minor grid lines (if any) plotted against the<a name="line.2081"></a>
- <span class="sourceLineNo">2082</span> * range axis.<a name="line.2082"></a>
- <span class="sourceLineNo">2083</span> *<a name="line.2083"></a>
- <span class="sourceLineNo">2084</span> * @return The paint (never <code>null</code>).<a name="line.2084"></a>
- <span class="sourceLineNo">2085</span> *<a name="line.2085"></a>
- <span class="sourceLineNo">2086</span> * @see #setRangeMinorGridlinePaint(Paint)<a name="line.2086"></a>
- <span class="sourceLineNo">2087</span> *<a name="line.2087"></a>
- <span class="sourceLineNo">2088</span> * @since 1.0.12<a name="line.2088"></a>
- <span class="sourceLineNo">2089</span> */<a name="line.2089"></a>
- <span class="sourceLineNo">2090</span> public Paint getRangeMinorGridlinePaint() {<a name="line.2090"></a>
- <span class="sourceLineNo">2091</span> return this.rangeMinorGridlinePaint;<a name="line.2091"></a>
- <span class="sourceLineNo">2092</span> }<a name="line.2092"></a>
- <span class="sourceLineNo">2093</span><a name="line.2093"></a>
- <span class="sourceLineNo">2094</span> /**<a name="line.2094"></a>
- <span class="sourceLineNo">2095</span> * Sets the paint for the minor grid lines plotted against the range axis<a name="line.2095"></a>
- <span class="sourceLineNo">2096</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2096"></a>
- <span class="sourceLineNo">2097</span> *<a name="line.2097"></a>
- <span class="sourceLineNo">2098</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.2098"></a>
- <span class="sourceLineNo">2099</span> *<a name="line.2099"></a>
- <span class="sourceLineNo">2100</span> * @see #getRangeMinorGridlinePaint()<a name="line.2100"></a>
- <span class="sourceLineNo">2101</span> *<a name="line.2101"></a>
- <span class="sourceLineNo">2102</span> * @since 1.0.12<a name="line.2102"></a>
- <span class="sourceLineNo">2103</span> */<a name="line.2103"></a>
- <span class="sourceLineNo">2104</span> public void setRangeMinorGridlinePaint(Paint paint) {<a name="line.2104"></a>
- <span class="sourceLineNo">2105</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.2105"></a>
- <span class="sourceLineNo">2106</span> this.rangeMinorGridlinePaint = paint;<a name="line.2106"></a>
- <span class="sourceLineNo">2107</span> fireChangeEvent();<a name="line.2107"></a>
- <span class="sourceLineNo">2108</span> }<a name="line.2108"></a>
- <span class="sourceLineNo">2109</span><a name="line.2109"></a>
- <span class="sourceLineNo">2110</span> /**<a name="line.2110"></a>
- <span class="sourceLineNo">2111</span> * Returns a flag that controls whether or not a zero baseline is<a name="line.2111"></a>
- <span class="sourceLineNo">2112</span> * displayed for the domain axis.<a name="line.2112"></a>
- <span class="sourceLineNo">2113</span> *<a name="line.2113"></a>
- <span class="sourceLineNo">2114</span> * @return A boolean.<a name="line.2114"></a>
- <span class="sourceLineNo">2115</span> *<a name="line.2115"></a>
- <span class="sourceLineNo">2116</span> * @since 1.0.5<a name="line.2116"></a>
- <span class="sourceLineNo">2117</span> *<a name="line.2117"></a>
- <span class="sourceLineNo">2118</span> * @see #setDomainZeroBaselineVisible(boolean)<a name="line.2118"></a>
- <span class="sourceLineNo">2119</span> */<a name="line.2119"></a>
- <span class="sourceLineNo">2120</span> public boolean isDomainZeroBaselineVisible() {<a name="line.2120"></a>
- <span class="sourceLineNo">2121</span> return this.domainZeroBaselineVisible;<a name="line.2121"></a>
- <span class="sourceLineNo">2122</span> }<a name="line.2122"></a>
- <span class="sourceLineNo">2123</span><a name="line.2123"></a>
- <span class="sourceLineNo">2124</span> /**<a name="line.2124"></a>
- <span class="sourceLineNo">2125</span> * Sets the flag that controls whether or not the zero baseline is<a name="line.2125"></a>
- <span class="sourceLineNo">2126</span> * displayed for the domain axis, and sends a {@link PlotChangeEvent} to<a name="line.2126"></a>
- <span class="sourceLineNo">2127</span> * all registered listeners.<a name="line.2127"></a>
- <span class="sourceLineNo">2128</span> *<a name="line.2128"></a>
- <span class="sourceLineNo">2129</span> * @param visible the flag.<a name="line.2129"></a>
- <span class="sourceLineNo">2130</span> *<a name="line.2130"></a>
- <span class="sourceLineNo">2131</span> * @since 1.0.5<a name="line.2131"></a>
- <span class="sourceLineNo">2132</span> *<a name="line.2132"></a>
- <span class="sourceLineNo">2133</span> * @see #isDomainZeroBaselineVisible()<a name="line.2133"></a>
- <span class="sourceLineNo">2134</span> */<a name="line.2134"></a>
- <span class="sourceLineNo">2135</span> public void setDomainZeroBaselineVisible(boolean visible) {<a name="line.2135"></a>
- <span class="sourceLineNo">2136</span> this.domainZeroBaselineVisible = visible;<a name="line.2136"></a>
- <span class="sourceLineNo">2137</span> fireChangeEvent();<a name="line.2137"></a>
- <span class="sourceLineNo">2138</span> }<a name="line.2138"></a>
- <span class="sourceLineNo">2139</span><a name="line.2139"></a>
- <span class="sourceLineNo">2140</span> /**<a name="line.2140"></a>
- <span class="sourceLineNo">2141</span> * Returns the stroke used for the zero baseline against the domain axis.<a name="line.2141"></a>
- <span class="sourceLineNo">2142</span> *<a name="line.2142"></a>
- <span class="sourceLineNo">2143</span> * @return The stroke (never <code>null</code>).<a name="line.2143"></a>
- <span class="sourceLineNo">2144</span> *<a name="line.2144"></a>
- <span class="sourceLineNo">2145</span> * @since 1.0.5<a name="line.2145"></a>
- <span class="sourceLineNo">2146</span> *<a name="line.2146"></a>
- <span class="sourceLineNo">2147</span> * @see #setDomainZeroBaselineStroke(Stroke)<a name="line.2147"></a>
- <span class="sourceLineNo">2148</span> */<a name="line.2148"></a>
- <span class="sourceLineNo">2149</span> public Stroke getDomainZeroBaselineStroke() {<a name="line.2149"></a>
- <span class="sourceLineNo">2150</span> return this.domainZeroBaselineStroke;<a name="line.2150"></a>
- <span class="sourceLineNo">2151</span> }<a name="line.2151"></a>
- <span class="sourceLineNo">2152</span><a name="line.2152"></a>
- <span class="sourceLineNo">2153</span> /**<a name="line.2153"></a>
- <span class="sourceLineNo">2154</span> * Sets the stroke for the zero baseline for the domain axis,<a name="line.2154"></a>
- <span class="sourceLineNo">2155</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2155"></a>
- <span class="sourceLineNo">2156</span> *<a name="line.2156"></a>
- <span class="sourceLineNo">2157</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.2157"></a>
- <span class="sourceLineNo">2158</span> *<a name="line.2158"></a>
- <span class="sourceLineNo">2159</span> * @since 1.0.5<a name="line.2159"></a>
- <span class="sourceLineNo">2160</span> *<a name="line.2160"></a>
- <span class="sourceLineNo">2161</span> * @see #getRangeZeroBaselineStroke()<a name="line.2161"></a>
- <span class="sourceLineNo">2162</span> */<a name="line.2162"></a>
- <span class="sourceLineNo">2163</span> public void setDomainZeroBaselineStroke(Stroke stroke) {<a name="line.2163"></a>
- <span class="sourceLineNo">2164</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.2164"></a>
- <span class="sourceLineNo">2165</span> this.domainZeroBaselineStroke = stroke;<a name="line.2165"></a>
- <span class="sourceLineNo">2166</span> fireChangeEvent();<a name="line.2166"></a>
- <span class="sourceLineNo">2167</span> }<a name="line.2167"></a>
- <span class="sourceLineNo">2168</span><a name="line.2168"></a>
- <span class="sourceLineNo">2169</span> /**<a name="line.2169"></a>
- <span class="sourceLineNo">2170</span> * Returns the paint for the zero baseline (if any) plotted against the<a name="line.2170"></a>
- <span class="sourceLineNo">2171</span> * domain axis.<a name="line.2171"></a>
- <span class="sourceLineNo">2172</span> *<a name="line.2172"></a>
- <span class="sourceLineNo">2173</span> * @since 1.0.5<a name="line.2173"></a>
- <span class="sourceLineNo">2174</span> *<a name="line.2174"></a>
- <span class="sourceLineNo">2175</span> * @return The paint (never <code>null</code>).<a name="line.2175"></a>
- <span class="sourceLineNo">2176</span> *<a name="line.2176"></a>
- <span class="sourceLineNo">2177</span> * @see #setDomainZeroBaselinePaint(Paint)<a name="line.2177"></a>
- <span class="sourceLineNo">2178</span> */<a name="line.2178"></a>
- <span class="sourceLineNo">2179</span> public Paint getDomainZeroBaselinePaint() {<a name="line.2179"></a>
- <span class="sourceLineNo">2180</span> return this.domainZeroBaselinePaint;<a name="line.2180"></a>
- <span class="sourceLineNo">2181</span> }<a name="line.2181"></a>
- <span class="sourceLineNo">2182</span><a name="line.2182"></a>
- <span class="sourceLineNo">2183</span> /**<a name="line.2183"></a>
- <span class="sourceLineNo">2184</span> * Sets the paint for the zero baseline plotted against the domain axis and<a name="line.2184"></a>
- <span class="sourceLineNo">2185</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2185"></a>
- <span class="sourceLineNo">2186</span> *<a name="line.2186"></a>
- <span class="sourceLineNo">2187</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.2187"></a>
- <span class="sourceLineNo">2188</span> *<a name="line.2188"></a>
- <span class="sourceLineNo">2189</span> * @since 1.0.5<a name="line.2189"></a>
- <span class="sourceLineNo">2190</span> *<a name="line.2190"></a>
- <span class="sourceLineNo">2191</span> * @see #getDomainZeroBaselinePaint()<a name="line.2191"></a>
- <span class="sourceLineNo">2192</span> */<a name="line.2192"></a>
- <span class="sourceLineNo">2193</span> public void setDomainZeroBaselinePaint(Paint paint) {<a name="line.2193"></a>
- <span class="sourceLineNo">2194</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.2194"></a>
- <span class="sourceLineNo">2195</span> this.domainZeroBaselinePaint = paint;<a name="line.2195"></a>
- <span class="sourceLineNo">2196</span> fireChangeEvent();<a name="line.2196"></a>
- <span class="sourceLineNo">2197</span> }<a name="line.2197"></a>
- <span class="sourceLineNo">2198</span><a name="line.2198"></a>
- <span class="sourceLineNo">2199</span> /**<a name="line.2199"></a>
- <span class="sourceLineNo">2200</span> * Returns a flag that controls whether or not a zero baseline is<a name="line.2200"></a>
- <span class="sourceLineNo">2201</span> * displayed for the range axis.<a name="line.2201"></a>
- <span class="sourceLineNo">2202</span> *<a name="line.2202"></a>
- <span class="sourceLineNo">2203</span> * @return A boolean.<a name="line.2203"></a>
- <span class="sourceLineNo">2204</span> *<a name="line.2204"></a>
- <span class="sourceLineNo">2205</span> * @see #setRangeZeroBaselineVisible(boolean)<a name="line.2205"></a>
- <span class="sourceLineNo">2206</span> */<a name="line.2206"></a>
- <span class="sourceLineNo">2207</span> public boolean isRangeZeroBaselineVisible() {<a name="line.2207"></a>
- <span class="sourceLineNo">2208</span> return this.rangeZeroBaselineVisible;<a name="line.2208"></a>
- <span class="sourceLineNo">2209</span> }<a name="line.2209"></a>
- <span class="sourceLineNo">2210</span><a name="line.2210"></a>
- <span class="sourceLineNo">2211</span> /**<a name="line.2211"></a>
- <span class="sourceLineNo">2212</span> * Sets the flag that controls whether or not the zero baseline is<a name="line.2212"></a>
- <span class="sourceLineNo">2213</span> * displayed for the range axis, and sends a {@link PlotChangeEvent} to<a name="line.2213"></a>
- <span class="sourceLineNo">2214</span> * all registered listeners.<a name="line.2214"></a>
- <span class="sourceLineNo">2215</span> *<a name="line.2215"></a>
- <span class="sourceLineNo">2216</span> * @param visible the flag.<a name="line.2216"></a>
- <span class="sourceLineNo">2217</span> *<a name="line.2217"></a>
- <span class="sourceLineNo">2218</span> * @see #isRangeZeroBaselineVisible()<a name="line.2218"></a>
- <span class="sourceLineNo">2219</span> */<a name="line.2219"></a>
- <span class="sourceLineNo">2220</span> public void setRangeZeroBaselineVisible(boolean visible) {<a name="line.2220"></a>
- <span class="sourceLineNo">2221</span> this.rangeZeroBaselineVisible = visible;<a name="line.2221"></a>
- <span class="sourceLineNo">2222</span> fireChangeEvent();<a name="line.2222"></a>
- <span class="sourceLineNo">2223</span> }<a name="line.2223"></a>
- <span class="sourceLineNo">2224</span><a name="line.2224"></a>
- <span class="sourceLineNo">2225</span> /**<a name="line.2225"></a>
- <span class="sourceLineNo">2226</span> * Returns the stroke used for the zero baseline against the range axis.<a name="line.2226"></a>
- <span class="sourceLineNo">2227</span> *<a name="line.2227"></a>
- <span class="sourceLineNo">2228</span> * @return The stroke (never <code>null</code>).<a name="line.2228"></a>
- <span class="sourceLineNo">2229</span> *<a name="line.2229"></a>
- <span class="sourceLineNo">2230</span> * @see #setRangeZeroBaselineStroke(Stroke)<a name="line.2230"></a>
- <span class="sourceLineNo">2231</span> */<a name="line.2231"></a>
- <span class="sourceLineNo">2232</span> public Stroke getRangeZeroBaselineStroke() {<a name="line.2232"></a>
- <span class="sourceLineNo">2233</span> return this.rangeZeroBaselineStroke;<a name="line.2233"></a>
- <span class="sourceLineNo">2234</span> }<a name="line.2234"></a>
- <span class="sourceLineNo">2235</span><a name="line.2235"></a>
- <span class="sourceLineNo">2236</span> /**<a name="line.2236"></a>
- <span class="sourceLineNo">2237</span> * Sets the stroke for the zero baseline for the range axis,<a name="line.2237"></a>
- <span class="sourceLineNo">2238</span> * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2238"></a>
- <span class="sourceLineNo">2239</span> *<a name="line.2239"></a>
- <span class="sourceLineNo">2240</span> * @param stroke the stroke (<code>null</code> not permitted).<a name="line.2240"></a>
- <span class="sourceLineNo">2241</span> *<a name="line.2241"></a>
- <span class="sourceLineNo">2242</span> * @see #getRangeZeroBaselineStroke()<a name="line.2242"></a>
- <span class="sourceLineNo">2243</span> */<a name="line.2243"></a>
- <span class="sourceLineNo">2244</span> public void setRangeZeroBaselineStroke(Stroke stroke) {<a name="line.2244"></a>
- <span class="sourceLineNo">2245</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.2245"></a>
- <span class="sourceLineNo">2246</span> this.rangeZeroBaselineStroke = stroke;<a name="line.2246"></a>
- <span class="sourceLineNo">2247</span> fireChangeEvent();<a name="line.2247"></a>
- <span class="sourceLineNo">2248</span> }<a name="line.2248"></a>
- <span class="sourceLineNo">2249</span><a name="line.2249"></a>
- <span class="sourceLineNo">2250</span> /**<a name="line.2250"></a>
- <span class="sourceLineNo">2251</span> * Returns the paint for the zero baseline (if any) plotted against the<a name="line.2251"></a>
- <span class="sourceLineNo">2252</span> * range axis.<a name="line.2252"></a>
- <span class="sourceLineNo">2253</span> *<a name="line.2253"></a>
- <span class="sourceLineNo">2254</span> * @return The paint (never <code>null</code>).<a name="line.2254"></a>
- <span class="sourceLineNo">2255</span> *<a name="line.2255"></a>
- <span class="sourceLineNo">2256</span> * @see #setRangeZeroBaselinePaint(Paint)<a name="line.2256"></a>
- <span class="sourceLineNo">2257</span> */<a name="line.2257"></a>
- <span class="sourceLineNo">2258</span> public Paint getRangeZeroBaselinePaint() {<a name="line.2258"></a>
- <span class="sourceLineNo">2259</span> return this.rangeZeroBaselinePaint;<a name="line.2259"></a>
- <span class="sourceLineNo">2260</span> }<a name="line.2260"></a>
- <span class="sourceLineNo">2261</span><a name="line.2261"></a>
- <span class="sourceLineNo">2262</span> /**<a name="line.2262"></a>
- <span class="sourceLineNo">2263</span> * Sets the paint for the zero baseline plotted against the range axis and<a name="line.2263"></a>
- <span class="sourceLineNo">2264</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2264"></a>
- <span class="sourceLineNo">2265</span> *<a name="line.2265"></a>
- <span class="sourceLineNo">2266</span> * @param paint the paint (<code>null</code> not permitted).<a name="line.2266"></a>
- <span class="sourceLineNo">2267</span> *<a name="line.2267"></a>
- <span class="sourceLineNo">2268</span> * @see #getRangeZeroBaselinePaint()<a name="line.2268"></a>
- <span class="sourceLineNo">2269</span> */<a name="line.2269"></a>
- <span class="sourceLineNo">2270</span> public void setRangeZeroBaselinePaint(Paint paint) {<a name="line.2270"></a>
- <span class="sourceLineNo">2271</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.2271"></a>
- <span class="sourceLineNo">2272</span> this.rangeZeroBaselinePaint = paint;<a name="line.2272"></a>
- <span class="sourceLineNo">2273</span> fireChangeEvent();<a name="line.2273"></a>
- <span class="sourceLineNo">2274</span> }<a name="line.2274"></a>
- <span class="sourceLineNo">2275</span><a name="line.2275"></a>
- <span class="sourceLineNo">2276</span> /**<a name="line.2276"></a>
- <span class="sourceLineNo">2277</span> * Returns the paint used for the domain tick bands. If this is<a name="line.2277"></a>
- <span class="sourceLineNo">2278</span> * <code>null</code>, no tick bands will be drawn.<a name="line.2278"></a>
- <span class="sourceLineNo">2279</span> *<a name="line.2279"></a>
- <span class="sourceLineNo">2280</span> * @return The paint (possibly <code>null</code>).<a name="line.2280"></a>
- <span class="sourceLineNo">2281</span> *<a name="line.2281"></a>
- <span class="sourceLineNo">2282</span> * @see #setDomainTickBandPaint(Paint)<a name="line.2282"></a>
- <span class="sourceLineNo">2283</span> */<a name="line.2283"></a>
- <span class="sourceLineNo">2284</span> public Paint getDomainTickBandPaint() {<a name="line.2284"></a>
- <span class="sourceLineNo">2285</span> return this.domainTickBandPaint;<a name="line.2285"></a>
- <span class="sourceLineNo">2286</span> }<a name="line.2286"></a>
- <span class="sourceLineNo">2287</span><a name="line.2287"></a>
- <span class="sourceLineNo">2288</span> /**<a name="line.2288"></a>
- <span class="sourceLineNo">2289</span> * Sets the paint for the domain tick bands.<a name="line.2289"></a>
- <span class="sourceLineNo">2290</span> *<a name="line.2290"></a>
- <span class="sourceLineNo">2291</span> * @param paint the paint (<code>null</code> permitted).<a name="line.2291"></a>
- <span class="sourceLineNo">2292</span> *<a name="line.2292"></a>
- <span class="sourceLineNo">2293</span> * @see #getDomainTickBandPaint()<a name="line.2293"></a>
- <span class="sourceLineNo">2294</span> */<a name="line.2294"></a>
- <span class="sourceLineNo">2295</span> public void setDomainTickBandPaint(Paint paint) {<a name="line.2295"></a>
- <span class="sourceLineNo">2296</span> this.domainTickBandPaint = paint;<a name="line.2296"></a>
- <span class="sourceLineNo">2297</span> fireChangeEvent();<a name="line.2297"></a>
- <span class="sourceLineNo">2298</span> }<a name="line.2298"></a>
- <span class="sourceLineNo">2299</span><a name="line.2299"></a>
- <span class="sourceLineNo">2300</span> /**<a name="line.2300"></a>
- <span class="sourceLineNo">2301</span> * Returns the paint used for the range tick bands. If this is<a name="line.2301"></a>
- <span class="sourceLineNo">2302</span> * <code>null</code>, no tick bands will be drawn.<a name="line.2302"></a>
- <span class="sourceLineNo">2303</span> *<a name="line.2303"></a>
- <span class="sourceLineNo">2304</span> * @return The paint (possibly <code>null</code>).<a name="line.2304"></a>
- <span class="sourceLineNo">2305</span> *<a name="line.2305"></a>
- <span class="sourceLineNo">2306</span> * @see #setRangeTickBandPaint(Paint)<a name="line.2306"></a>
- <span class="sourceLineNo">2307</span> */<a name="line.2307"></a>
- <span class="sourceLineNo">2308</span> public Paint getRangeTickBandPaint() {<a name="line.2308"></a>
- <span class="sourceLineNo">2309</span> return this.rangeTickBandPaint;<a name="line.2309"></a>
- <span class="sourceLineNo">2310</span> }<a name="line.2310"></a>
- <span class="sourceLineNo">2311</span><a name="line.2311"></a>
- <span class="sourceLineNo">2312</span> /**<a name="line.2312"></a>
- <span class="sourceLineNo">2313</span> * Sets the paint for the range tick bands.<a name="line.2313"></a>
- <span class="sourceLineNo">2314</span> *<a name="line.2314"></a>
- <span class="sourceLineNo">2315</span> * @param paint the paint (<code>null</code> permitted).<a name="line.2315"></a>
- <span class="sourceLineNo">2316</span> *<a name="line.2316"></a>
- <span class="sourceLineNo">2317</span> * @see #getRangeTickBandPaint()<a name="line.2317"></a>
- <span class="sourceLineNo">2318</span> */<a name="line.2318"></a>
- <span class="sourceLineNo">2319</span> public void setRangeTickBandPaint(Paint paint) {<a name="line.2319"></a>
- <span class="sourceLineNo">2320</span> this.rangeTickBandPaint = paint;<a name="line.2320"></a>
- <span class="sourceLineNo">2321</span> fireChangeEvent();<a name="line.2321"></a>
- <span class="sourceLineNo">2322</span> }<a name="line.2322"></a>
- <span class="sourceLineNo">2323</span><a name="line.2323"></a>
- <span class="sourceLineNo">2324</span> /**<a name="line.2324"></a>
- <span class="sourceLineNo">2325</span> * Returns the origin for the quadrants that can be displayed on the plot.<a name="line.2325"></a>
- <span class="sourceLineNo">2326</span> * This defaults to (0, 0).<a name="line.2326"></a>
- <span class="sourceLineNo">2327</span> *<a name="line.2327"></a>
- <span class="sourceLineNo">2328</span> * @return The origin point (never <code>null</code>).<a name="line.2328"></a>
- <span class="sourceLineNo">2329</span> *<a name="line.2329"></a>
- <span class="sourceLineNo">2330</span> * @see #setQuadrantOrigin(Point2D)<a name="line.2330"></a>
- <span class="sourceLineNo">2331</span> */<a name="line.2331"></a>
- <span class="sourceLineNo">2332</span> public Point2D getQuadrantOrigin() {<a name="line.2332"></a>
- <span class="sourceLineNo">2333</span> return this.quadrantOrigin;<a name="line.2333"></a>
- <span class="sourceLineNo">2334</span> }<a name="line.2334"></a>
- <span class="sourceLineNo">2335</span><a name="line.2335"></a>
- <span class="sourceLineNo">2336</span> /**<a name="line.2336"></a>
- <span class="sourceLineNo">2337</span> * Sets the quadrant origin and sends a {@link PlotChangeEvent} to all<a name="line.2337"></a>
- <span class="sourceLineNo">2338</span> * registered listeners.<a name="line.2338"></a>
- <span class="sourceLineNo">2339</span> *<a name="line.2339"></a>
- <span class="sourceLineNo">2340</span> * @param origin the origin (<code>null</code> not permitted).<a name="line.2340"></a>
- <span class="sourceLineNo">2341</span> *<a name="line.2341"></a>
- <span class="sourceLineNo">2342</span> * @see #getQuadrantOrigin()<a name="line.2342"></a>
- <span class="sourceLineNo">2343</span> */<a name="line.2343"></a>
- <span class="sourceLineNo">2344</span> public void setQuadrantOrigin(Point2D origin) {<a name="line.2344"></a>
- <span class="sourceLineNo">2345</span> ParamChecks.nullNotPermitted(origin, "origin");<a name="line.2345"></a>
- <span class="sourceLineNo">2346</span> this.quadrantOrigin = origin;<a name="line.2346"></a>
- <span class="sourceLineNo">2347</span> fireChangeEvent();<a name="line.2347"></a>
- <span class="sourceLineNo">2348</span> }<a name="line.2348"></a>
- <span class="sourceLineNo">2349</span><a name="line.2349"></a>
- <span class="sourceLineNo">2350</span> /**<a name="line.2350"></a>
- <span class="sourceLineNo">2351</span> * Returns the paint used for the specified quadrant.<a name="line.2351"></a>
- <span class="sourceLineNo">2352</span> *<a name="line.2352"></a>
- <span class="sourceLineNo">2353</span> * @param index the quadrant index (0-3).<a name="line.2353"></a>
- <span class="sourceLineNo">2354</span> *<a name="line.2354"></a>
- <span class="sourceLineNo">2355</span> * @return The paint (possibly <code>null</code>).<a name="line.2355"></a>
- <span class="sourceLineNo">2356</span> *<a name="line.2356"></a>
- <span class="sourceLineNo">2357</span> * @see #setQuadrantPaint(int, Paint)<a name="line.2357"></a>
- <span class="sourceLineNo">2358</span> */<a name="line.2358"></a>
- <span class="sourceLineNo">2359</span> public Paint getQuadrantPaint(int index) {<a name="line.2359"></a>
- <span class="sourceLineNo">2360</span> if (index < 0 || index > 3) {<a name="line.2360"></a>
- <span class="sourceLineNo">2361</span> throw new IllegalArgumentException("The index value (" + index<a name="line.2361"></a>
- <span class="sourceLineNo">2362</span> + ") should be in the range 0 to 3.");<a name="line.2362"></a>
- <span class="sourceLineNo">2363</span> }<a name="line.2363"></a>
- <span class="sourceLineNo">2364</span> return this.quadrantPaint[index];<a name="line.2364"></a>
- <span class="sourceLineNo">2365</span> }<a name="line.2365"></a>
- <span class="sourceLineNo">2366</span><a name="line.2366"></a>
- <span class="sourceLineNo">2367</span> /**<a name="line.2367"></a>
- <span class="sourceLineNo">2368</span> * Sets the paint used for the specified quadrant and sends a<a name="line.2368"></a>
- <span class="sourceLineNo">2369</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2369"></a>
- <span class="sourceLineNo">2370</span> *<a name="line.2370"></a>
- <span class="sourceLineNo">2371</span> * @param index the quadrant index (0-3).<a name="line.2371"></a>
- <span class="sourceLineNo">2372</span> * @param paint the paint (<code>null</code> permitted).<a name="line.2372"></a>
- <span class="sourceLineNo">2373</span> *<a name="line.2373"></a>
- <span class="sourceLineNo">2374</span> * @see #getQuadrantPaint(int)<a name="line.2374"></a>
- <span class="sourceLineNo">2375</span> */<a name="line.2375"></a>
- <span class="sourceLineNo">2376</span> public void setQuadrantPaint(int index, Paint paint) {<a name="line.2376"></a>
- <span class="sourceLineNo">2377</span> if (index < 0 || index > 3) {<a name="line.2377"></a>
- <span class="sourceLineNo">2378</span> throw new IllegalArgumentException("The index value (" + index<a name="line.2378"></a>
- <span class="sourceLineNo">2379</span> + ") should be in the range 0 to 3.");<a name="line.2379"></a>
- <span class="sourceLineNo">2380</span> }<a name="line.2380"></a>
- <span class="sourceLineNo">2381</span> this.quadrantPaint[index] = paint;<a name="line.2381"></a>
- <span class="sourceLineNo">2382</span> fireChangeEvent();<a name="line.2382"></a>
- <span class="sourceLineNo">2383</span> }<a name="line.2383"></a>
- <span class="sourceLineNo">2384</span><a name="line.2384"></a>
- <span class="sourceLineNo">2385</span> /**<a name="line.2385"></a>
- <span class="sourceLineNo">2386</span> * Adds a marker for the domain axis and sends a {@link PlotChangeEvent}<a name="line.2386"></a>
- <span class="sourceLineNo">2387</span> * to all registered listeners.<a name="line.2387"></a>
- <span class="sourceLineNo">2388</span> * <P><a name="line.2388"></a>
- <span class="sourceLineNo">2389</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2389"></a>
- <span class="sourceLineNo">2390</span> * to the domain axis, however this is entirely up to the renderer.<a name="line.2390"></a>
- <span class="sourceLineNo">2391</span> *<a name="line.2391"></a>
- <span class="sourceLineNo">2392</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2392"></a>
- <span class="sourceLineNo">2393</span> *<a name="line.2393"></a>
- <span class="sourceLineNo">2394</span> * @see #addDomainMarker(Marker, Layer)<a name="line.2394"></a>
- <span class="sourceLineNo">2395</span> * @see #clearDomainMarkers()<a name="line.2395"></a>
- <span class="sourceLineNo">2396</span> */<a name="line.2396"></a>
- <span class="sourceLineNo">2397</span> public void addDomainMarker(Marker marker) {<a name="line.2397"></a>
- <span class="sourceLineNo">2398</span> // defer argument checking...<a name="line.2398"></a>
- <span class="sourceLineNo">2399</span> addDomainMarker(marker, Layer.FOREGROUND);<a name="line.2399"></a>
- <span class="sourceLineNo">2400</span> }<a name="line.2400"></a>
- <span class="sourceLineNo">2401</span><a name="line.2401"></a>
- <span class="sourceLineNo">2402</span> /**<a name="line.2402"></a>
- <span class="sourceLineNo">2403</span> * Adds a marker for the domain axis in the specified layer and sends a<a name="line.2403"></a>
- <span class="sourceLineNo">2404</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2404"></a>
- <span class="sourceLineNo">2405</span> * <P><a name="line.2405"></a>
- <span class="sourceLineNo">2406</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2406"></a>
- <span class="sourceLineNo">2407</span> * to the domain axis, however this is entirely up to the renderer.<a name="line.2407"></a>
- <span class="sourceLineNo">2408</span> *<a name="line.2408"></a>
- <span class="sourceLineNo">2409</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2409"></a>
- <span class="sourceLineNo">2410</span> * @param layer the layer (foreground or background).<a name="line.2410"></a>
- <span class="sourceLineNo">2411</span> *<a name="line.2411"></a>
- <span class="sourceLineNo">2412</span> * @see #addDomainMarker(int, Marker, Layer)<a name="line.2412"></a>
- <span class="sourceLineNo">2413</span> */<a name="line.2413"></a>
- <span class="sourceLineNo">2414</span> public void addDomainMarker(Marker marker, Layer layer) {<a name="line.2414"></a>
- <span class="sourceLineNo">2415</span> addDomainMarker(0, marker, layer);<a name="line.2415"></a>
- <span class="sourceLineNo">2416</span> }<a name="line.2416"></a>
- <span class="sourceLineNo">2417</span><a name="line.2417"></a>
- <span class="sourceLineNo">2418</span> /**<a name="line.2418"></a>
- <span class="sourceLineNo">2419</span> * Clears all the (foreground and background) domain markers and sends a<a name="line.2419"></a>
- <span class="sourceLineNo">2420</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2420"></a>
- <span class="sourceLineNo">2421</span> *<a name="line.2421"></a>
- <span class="sourceLineNo">2422</span> * @see #addDomainMarker(int, Marker, Layer)<a name="line.2422"></a>
- <span class="sourceLineNo">2423</span> */<a name="line.2423"></a>
- <span class="sourceLineNo">2424</span> public void clearDomainMarkers() {<a name="line.2424"></a>
- <span class="sourceLineNo">2425</span> if (this.backgroundDomainMarkers != null) {<a name="line.2425"></a>
- <span class="sourceLineNo">2426</span> Set<Integer> keys = this.backgroundDomainMarkers.keySet();<a name="line.2426"></a>
- <span class="sourceLineNo">2427</span> for (Integer key : keys) {<a name="line.2427"></a>
- <span class="sourceLineNo">2428</span> clearDomainMarkers(key);<a name="line.2428"></a>
- <span class="sourceLineNo">2429</span> }<a name="line.2429"></a>
- <span class="sourceLineNo">2430</span> this.backgroundDomainMarkers.clear();<a name="line.2430"></a>
- <span class="sourceLineNo">2431</span> }<a name="line.2431"></a>
- <span class="sourceLineNo">2432</span> if (this.foregroundDomainMarkers != null) {<a name="line.2432"></a>
- <span class="sourceLineNo">2433</span> Set<Integer> keys = this.foregroundDomainMarkers.keySet();<a name="line.2433"></a>
- <span class="sourceLineNo">2434</span> for (Integer key : keys) {<a name="line.2434"></a>
- <span class="sourceLineNo">2435</span> clearDomainMarkers(key);<a name="line.2435"></a>
- <span class="sourceLineNo">2436</span> }<a name="line.2436"></a>
- <span class="sourceLineNo">2437</span> this.foregroundDomainMarkers.clear();<a name="line.2437"></a>
- <span class="sourceLineNo">2438</span> }<a name="line.2438"></a>
- <span class="sourceLineNo">2439</span> fireChangeEvent();<a name="line.2439"></a>
- <span class="sourceLineNo">2440</span> }<a name="line.2440"></a>
- <span class="sourceLineNo">2441</span><a name="line.2441"></a>
- <span class="sourceLineNo">2442</span> /**<a name="line.2442"></a>
- <span class="sourceLineNo">2443</span> * Clears the (foreground and background) domain markers for a particular<a name="line.2443"></a>
- <span class="sourceLineNo">2444</span> * renderer and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2444"></a>
- <span class="sourceLineNo">2445</span> *<a name="line.2445"></a>
- <span class="sourceLineNo">2446</span> * @param index the renderer index.<a name="line.2446"></a>
- <span class="sourceLineNo">2447</span> *<a name="line.2447"></a>
- <span class="sourceLineNo">2448</span> * @see #clearRangeMarkers(int)<a name="line.2448"></a>
- <span class="sourceLineNo">2449</span> */<a name="line.2449"></a>
- <span class="sourceLineNo">2450</span> public void clearDomainMarkers(int index) {<a name="line.2450"></a>
- <span class="sourceLineNo">2451</span> Integer key = new Integer(index);<a name="line.2451"></a>
- <span class="sourceLineNo">2452</span> if (this.backgroundDomainMarkers != null) {<a name="line.2452"></a>
- <span class="sourceLineNo">2453</span> Collection markers<a name="line.2453"></a>
- <span class="sourceLineNo">2454</span> = (Collection) this.backgroundDomainMarkers.get(key);<a name="line.2454"></a>
- <span class="sourceLineNo">2455</span> if (markers != null) {<a name="line.2455"></a>
- <span class="sourceLineNo">2456</span> Iterator iterator = markers.iterator();<a name="line.2456"></a>
- <span class="sourceLineNo">2457</span> while (iterator.hasNext()) {<a name="line.2457"></a>
- <span class="sourceLineNo">2458</span> Marker m = (Marker) iterator.next();<a name="line.2458"></a>
- <span class="sourceLineNo">2459</span> m.removeChangeListener(this);<a name="line.2459"></a>
- <span class="sourceLineNo">2460</span> }<a name="line.2460"></a>
- <span class="sourceLineNo">2461</span> markers.clear();<a name="line.2461"></a>
- <span class="sourceLineNo">2462</span> }<a name="line.2462"></a>
- <span class="sourceLineNo">2463</span> }<a name="line.2463"></a>
- <span class="sourceLineNo">2464</span> if (this.foregroundRangeMarkers != null) {<a name="line.2464"></a>
- <span class="sourceLineNo">2465</span> Collection markers<a name="line.2465"></a>
- <span class="sourceLineNo">2466</span> = (Collection) this.foregroundDomainMarkers.get(key);<a name="line.2466"></a>
- <span class="sourceLineNo">2467</span> if (markers != null) {<a name="line.2467"></a>
- <span class="sourceLineNo">2468</span> Iterator iterator = markers.iterator();<a name="line.2468"></a>
- <span class="sourceLineNo">2469</span> while (iterator.hasNext()) {<a name="line.2469"></a>
- <span class="sourceLineNo">2470</span> Marker m = (Marker) iterator.next();<a name="line.2470"></a>
- <span class="sourceLineNo">2471</span> m.removeChangeListener(this);<a name="line.2471"></a>
- <span class="sourceLineNo">2472</span> }<a name="line.2472"></a>
- <span class="sourceLineNo">2473</span> markers.clear();<a name="line.2473"></a>
- <span class="sourceLineNo">2474</span> }<a name="line.2474"></a>
- <span class="sourceLineNo">2475</span> }<a name="line.2475"></a>
- <span class="sourceLineNo">2476</span> fireChangeEvent();<a name="line.2476"></a>
- <span class="sourceLineNo">2477</span> }<a name="line.2477"></a>
- <span class="sourceLineNo">2478</span><a name="line.2478"></a>
- <span class="sourceLineNo">2479</span> /**<a name="line.2479"></a>
- <span class="sourceLineNo">2480</span> * Adds a marker for a specific dataset/renderer and sends a<a name="line.2480"></a>
- <span class="sourceLineNo">2481</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2481"></a>
- <span class="sourceLineNo">2482</span> * <P><a name="line.2482"></a>
- <span class="sourceLineNo">2483</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2483"></a>
- <span class="sourceLineNo">2484</span> * to the domain axis (that the renderer is mapped to), however this is<a name="line.2484"></a>
- <span class="sourceLineNo">2485</span> * entirely up to the renderer.<a name="line.2485"></a>
- <span class="sourceLineNo">2486</span> *<a name="line.2486"></a>
- <span class="sourceLineNo">2487</span> * @param index the dataset/renderer index.<a name="line.2487"></a>
- <span class="sourceLineNo">2488</span> * @param marker the marker.<a name="line.2488"></a>
- <span class="sourceLineNo">2489</span> * @param layer the layer (foreground or background).<a name="line.2489"></a>
- <span class="sourceLineNo">2490</span> *<a name="line.2490"></a>
- <span class="sourceLineNo">2491</span> * @see #clearDomainMarkers(int)<a name="line.2491"></a>
- <span class="sourceLineNo">2492</span> * @see #addRangeMarker(int, Marker, Layer)<a name="line.2492"></a>
- <span class="sourceLineNo">2493</span> */<a name="line.2493"></a>
- <span class="sourceLineNo">2494</span> public void addDomainMarker(int index, Marker marker, Layer layer) {<a name="line.2494"></a>
- <span class="sourceLineNo">2495</span> addDomainMarker(index, marker, layer, true);<a name="line.2495"></a>
- <span class="sourceLineNo">2496</span> }<a name="line.2496"></a>
- <span class="sourceLineNo">2497</span><a name="line.2497"></a>
- <span class="sourceLineNo">2498</span> /**<a name="line.2498"></a>
- <span class="sourceLineNo">2499</span> * Adds a marker for a specific dataset/renderer and, if requested, sends a<a name="line.2499"></a>
- <span class="sourceLineNo">2500</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2500"></a>
- <span class="sourceLineNo">2501</span> * <P><a name="line.2501"></a>
- <span class="sourceLineNo">2502</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2502"></a>
- <span class="sourceLineNo">2503</span> * to the domain axis (that the renderer is mapped to), however this is<a name="line.2503"></a>
- <span class="sourceLineNo">2504</span> * entirely up to the renderer.<a name="line.2504"></a>
- <span class="sourceLineNo">2505</span> *<a name="line.2505"></a>
- <span class="sourceLineNo">2506</span> * @param index the dataset/renderer index.<a name="line.2506"></a>
- <span class="sourceLineNo">2507</span> * @param marker the marker.<a name="line.2507"></a>
- <span class="sourceLineNo">2508</span> * @param layer the layer (foreground or background).<a name="line.2508"></a>
- <span class="sourceLineNo">2509</span> * @param notify notify listeners?<a name="line.2509"></a>
- <span class="sourceLineNo">2510</span> *<a name="line.2510"></a>
- <span class="sourceLineNo">2511</span> * @since 1.0.10<a name="line.2511"></a>
- <span class="sourceLineNo">2512</span> */<a name="line.2512"></a>
- <span class="sourceLineNo">2513</span> public void addDomainMarker(int index, Marker marker, Layer layer,<a name="line.2513"></a>
- <span class="sourceLineNo">2514</span> boolean notify) {<a name="line.2514"></a>
- <span class="sourceLineNo">2515</span> ParamChecks.nullNotPermitted(marker, "marker");<a name="line.2515"></a>
- <span class="sourceLineNo">2516</span> ParamChecks.nullNotPermitted(layer, "layer");<a name="line.2516"></a>
- <span class="sourceLineNo">2517</span> Collection markers;<a name="line.2517"></a>
- <span class="sourceLineNo">2518</span> if (layer == Layer.FOREGROUND) {<a name="line.2518"></a>
- <span class="sourceLineNo">2519</span> markers = (Collection) this.foregroundDomainMarkers.get(<a name="line.2519"></a>
- <span class="sourceLineNo">2520</span> new Integer(index));<a name="line.2520"></a>
- <span class="sourceLineNo">2521</span> if (markers == null) {<a name="line.2521"></a>
- <span class="sourceLineNo">2522</span> markers = new java.util.ArrayList();<a name="line.2522"></a>
- <span class="sourceLineNo">2523</span> this.foregroundDomainMarkers.put(new Integer(index), markers);<a name="line.2523"></a>
- <span class="sourceLineNo">2524</span> }<a name="line.2524"></a>
- <span class="sourceLineNo">2525</span> markers.add(marker);<a name="line.2525"></a>
- <span class="sourceLineNo">2526</span> }<a name="line.2526"></a>
- <span class="sourceLineNo">2527</span> else if (layer == Layer.BACKGROUND) {<a name="line.2527"></a>
- <span class="sourceLineNo">2528</span> markers = (Collection) this.backgroundDomainMarkers.get(<a name="line.2528"></a>
- <span class="sourceLineNo">2529</span> new Integer(index));<a name="line.2529"></a>
- <span class="sourceLineNo">2530</span> if (markers == null) {<a name="line.2530"></a>
- <span class="sourceLineNo">2531</span> markers = new java.util.ArrayList();<a name="line.2531"></a>
- <span class="sourceLineNo">2532</span> this.backgroundDomainMarkers.put(new Integer(index), markers);<a name="line.2532"></a>
- <span class="sourceLineNo">2533</span> }<a name="line.2533"></a>
- <span class="sourceLineNo">2534</span> markers.add(marker);<a name="line.2534"></a>
- <span class="sourceLineNo">2535</span> }<a name="line.2535"></a>
- <span class="sourceLineNo">2536</span> marker.addChangeListener(this);<a name="line.2536"></a>
- <span class="sourceLineNo">2537</span> if (notify) {<a name="line.2537"></a>
- <span class="sourceLineNo">2538</span> fireChangeEvent();<a name="line.2538"></a>
- <span class="sourceLineNo">2539</span> }<a name="line.2539"></a>
- <span class="sourceLineNo">2540</span> }<a name="line.2540"></a>
- <span class="sourceLineNo">2541</span><a name="line.2541"></a>
- <span class="sourceLineNo">2542</span> /**<a name="line.2542"></a>
- <span class="sourceLineNo">2543</span> * Removes a marker for the domain axis and sends a {@link PlotChangeEvent}<a name="line.2543"></a>
- <span class="sourceLineNo">2544</span> * to all registered listeners.<a name="line.2544"></a>
- <span class="sourceLineNo">2545</span> *<a name="line.2545"></a>
- <span class="sourceLineNo">2546</span> * @param marker the marker.<a name="line.2546"></a>
- <span class="sourceLineNo">2547</span> *<a name="line.2547"></a>
- <span class="sourceLineNo">2548</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2548"></a>
- <span class="sourceLineNo">2549</span> * removed.<a name="line.2549"></a>
- <span class="sourceLineNo">2550</span> *<a name="line.2550"></a>
- <span class="sourceLineNo">2551</span> * @since 1.0.7<a name="line.2551"></a>
- <span class="sourceLineNo">2552</span> */<a name="line.2552"></a>
- <span class="sourceLineNo">2553</span> public boolean removeDomainMarker(Marker marker) {<a name="line.2553"></a>
- <span class="sourceLineNo">2554</span> return removeDomainMarker(marker, Layer.FOREGROUND);<a name="line.2554"></a>
- <span class="sourceLineNo">2555</span> }<a name="line.2555"></a>
- <span class="sourceLineNo">2556</span><a name="line.2556"></a>
- <span class="sourceLineNo">2557</span> /**<a name="line.2557"></a>
- <span class="sourceLineNo">2558</span> * Removes a marker for the domain axis in the specified layer and sends a<a name="line.2558"></a>
- <span class="sourceLineNo">2559</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2559"></a>
- <span class="sourceLineNo">2560</span> *<a name="line.2560"></a>
- <span class="sourceLineNo">2561</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2561"></a>
- <span class="sourceLineNo">2562</span> * @param layer the layer (foreground or background).<a name="line.2562"></a>
- <span class="sourceLineNo">2563</span> *<a name="line.2563"></a>
- <span class="sourceLineNo">2564</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2564"></a>
- <span class="sourceLineNo">2565</span> * removed.<a name="line.2565"></a>
- <span class="sourceLineNo">2566</span> *<a name="line.2566"></a>
- <span class="sourceLineNo">2567</span> * @since 1.0.7<a name="line.2567"></a>
- <span class="sourceLineNo">2568</span> */<a name="line.2568"></a>
- <span class="sourceLineNo">2569</span> public boolean removeDomainMarker(Marker marker, Layer layer) {<a name="line.2569"></a>
- <span class="sourceLineNo">2570</span> return removeDomainMarker(0, marker, layer);<a name="line.2570"></a>
- <span class="sourceLineNo">2571</span> }<a name="line.2571"></a>
- <span class="sourceLineNo">2572</span><a name="line.2572"></a>
- <span class="sourceLineNo">2573</span> /**<a name="line.2573"></a>
- <span class="sourceLineNo">2574</span> * Removes a marker for a specific dataset/renderer and sends a<a name="line.2574"></a>
- <span class="sourceLineNo">2575</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2575"></a>
- <span class="sourceLineNo">2576</span> *<a name="line.2576"></a>
- <span class="sourceLineNo">2577</span> * @param index the dataset/renderer index.<a name="line.2577"></a>
- <span class="sourceLineNo">2578</span> * @param marker the marker.<a name="line.2578"></a>
- <span class="sourceLineNo">2579</span> * @param layer the layer (foreground or background).<a name="line.2579"></a>
- <span class="sourceLineNo">2580</span> *<a name="line.2580"></a>
- <span class="sourceLineNo">2581</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2581"></a>
- <span class="sourceLineNo">2582</span> * removed.<a name="line.2582"></a>
- <span class="sourceLineNo">2583</span> *<a name="line.2583"></a>
- <span class="sourceLineNo">2584</span> * @since 1.0.7<a name="line.2584"></a>
- <span class="sourceLineNo">2585</span> */<a name="line.2585"></a>
- <span class="sourceLineNo">2586</span> public boolean removeDomainMarker(int index, Marker marker, Layer layer) {<a name="line.2586"></a>
- <span class="sourceLineNo">2587</span> return removeDomainMarker(index, marker, layer, true);<a name="line.2587"></a>
- <span class="sourceLineNo">2588</span> }<a name="line.2588"></a>
- <span class="sourceLineNo">2589</span><a name="line.2589"></a>
- <span class="sourceLineNo">2590</span> /**<a name="line.2590"></a>
- <span class="sourceLineNo">2591</span> * Removes a marker for a specific dataset/renderer and, if requested,<a name="line.2591"></a>
- <span class="sourceLineNo">2592</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2592"></a>
- <span class="sourceLineNo">2593</span> *<a name="line.2593"></a>
- <span class="sourceLineNo">2594</span> * @param index the dataset/renderer index.<a name="line.2594"></a>
- <span class="sourceLineNo">2595</span> * @param marker the marker.<a name="line.2595"></a>
- <span class="sourceLineNo">2596</span> * @param layer the layer (foreground or background).<a name="line.2596"></a>
- <span class="sourceLineNo">2597</span> * @param notify notify listeners?<a name="line.2597"></a>
- <span class="sourceLineNo">2598</span> *<a name="line.2598"></a>
- <span class="sourceLineNo">2599</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2599"></a>
- <span class="sourceLineNo">2600</span> * removed.<a name="line.2600"></a>
- <span class="sourceLineNo">2601</span> *<a name="line.2601"></a>
- <span class="sourceLineNo">2602</span> * @since 1.0.10<a name="line.2602"></a>
- <span class="sourceLineNo">2603</span> */<a name="line.2603"></a>
- <span class="sourceLineNo">2604</span> public boolean removeDomainMarker(int index, Marker marker, Layer layer,<a name="line.2604"></a>
- <span class="sourceLineNo">2605</span> boolean notify) {<a name="line.2605"></a>
- <span class="sourceLineNo">2606</span> ArrayList markers;<a name="line.2606"></a>
- <span class="sourceLineNo">2607</span> if (layer == Layer.FOREGROUND) {<a name="line.2607"></a>
- <span class="sourceLineNo">2608</span> markers = (ArrayList) this.foregroundDomainMarkers.get(<a name="line.2608"></a>
- <span class="sourceLineNo">2609</span> new Integer(index));<a name="line.2609"></a>
- <span class="sourceLineNo">2610</span> }<a name="line.2610"></a>
- <span class="sourceLineNo">2611</span> else {<a name="line.2611"></a>
- <span class="sourceLineNo">2612</span> markers = (ArrayList) this.backgroundDomainMarkers.get(<a name="line.2612"></a>
- <span class="sourceLineNo">2613</span> new Integer(index));<a name="line.2613"></a>
- <span class="sourceLineNo">2614</span> }<a name="line.2614"></a>
- <span class="sourceLineNo">2615</span> if (markers == null) {<a name="line.2615"></a>
- <span class="sourceLineNo">2616</span> return false;<a name="line.2616"></a>
- <span class="sourceLineNo">2617</span> }<a name="line.2617"></a>
- <span class="sourceLineNo">2618</span> boolean removed = markers.remove(marker);<a name="line.2618"></a>
- <span class="sourceLineNo">2619</span> if (removed && notify) {<a name="line.2619"></a>
- <span class="sourceLineNo">2620</span> fireChangeEvent();<a name="line.2620"></a>
- <span class="sourceLineNo">2621</span> }<a name="line.2621"></a>
- <span class="sourceLineNo">2622</span> return removed;<a name="line.2622"></a>
- <span class="sourceLineNo">2623</span> }<a name="line.2623"></a>
- <span class="sourceLineNo">2624</span><a name="line.2624"></a>
- <span class="sourceLineNo">2625</span> /**<a name="line.2625"></a>
- <span class="sourceLineNo">2626</span> * Adds a marker for the range axis and sends a {@link PlotChangeEvent} to<a name="line.2626"></a>
- <span class="sourceLineNo">2627</span> * all registered listeners.<a name="line.2627"></a>
- <span class="sourceLineNo">2628</span> * <P><a name="line.2628"></a>
- <span class="sourceLineNo">2629</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2629"></a>
- <span class="sourceLineNo">2630</span> * to the range axis, however this is entirely up to the renderer.<a name="line.2630"></a>
- <span class="sourceLineNo">2631</span> *<a name="line.2631"></a>
- <span class="sourceLineNo">2632</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2632"></a>
- <span class="sourceLineNo">2633</span> *<a name="line.2633"></a>
- <span class="sourceLineNo">2634</span> * @see #addRangeMarker(Marker, Layer)<a name="line.2634"></a>
- <span class="sourceLineNo">2635</span> */<a name="line.2635"></a>
- <span class="sourceLineNo">2636</span> public void addRangeMarker(Marker marker) {<a name="line.2636"></a>
- <span class="sourceLineNo">2637</span> addRangeMarker(marker, Layer.FOREGROUND);<a name="line.2637"></a>
- <span class="sourceLineNo">2638</span> }<a name="line.2638"></a>
- <span class="sourceLineNo">2639</span><a name="line.2639"></a>
- <span class="sourceLineNo">2640</span> /**<a name="line.2640"></a>
- <span class="sourceLineNo">2641</span> * Adds a marker for the range axis in the specified layer and sends a<a name="line.2641"></a>
- <span class="sourceLineNo">2642</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2642"></a>
- <span class="sourceLineNo">2643</span> * <P><a name="line.2643"></a>
- <span class="sourceLineNo">2644</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2644"></a>
- <span class="sourceLineNo">2645</span> * to the range axis, however this is entirely up to the renderer.<a name="line.2645"></a>
- <span class="sourceLineNo">2646</span> *<a name="line.2646"></a>
- <span class="sourceLineNo">2647</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2647"></a>
- <span class="sourceLineNo">2648</span> * @param layer the layer (foreground or background).<a name="line.2648"></a>
- <span class="sourceLineNo">2649</span> *<a name="line.2649"></a>
- <span class="sourceLineNo">2650</span> * @see #addRangeMarker(int, Marker, Layer)<a name="line.2650"></a>
- <span class="sourceLineNo">2651</span> */<a name="line.2651"></a>
- <span class="sourceLineNo">2652</span> public void addRangeMarker(Marker marker, Layer layer) {<a name="line.2652"></a>
- <span class="sourceLineNo">2653</span> addRangeMarker(0, marker, layer);<a name="line.2653"></a>
- <span class="sourceLineNo">2654</span> }<a name="line.2654"></a>
- <span class="sourceLineNo">2655</span><a name="line.2655"></a>
- <span class="sourceLineNo">2656</span> /**<a name="line.2656"></a>
- <span class="sourceLineNo">2657</span> * Clears all the range markers and sends a {@link PlotChangeEvent} to all<a name="line.2657"></a>
- <span class="sourceLineNo">2658</span> * registered listeners.<a name="line.2658"></a>
- <span class="sourceLineNo">2659</span> *<a name="line.2659"></a>
- <span class="sourceLineNo">2660</span> * @see #clearRangeMarkers()<a name="line.2660"></a>
- <span class="sourceLineNo">2661</span> */<a name="line.2661"></a>
- <span class="sourceLineNo">2662</span> public void clearRangeMarkers() {<a name="line.2662"></a>
- <span class="sourceLineNo">2663</span> if (this.backgroundRangeMarkers != null) {<a name="line.2663"></a>
- <span class="sourceLineNo">2664</span> Set<Integer> keys = this.backgroundRangeMarkers.keySet();<a name="line.2664"></a>
- <span class="sourceLineNo">2665</span> for (Integer key : keys) {<a name="line.2665"></a>
- <span class="sourceLineNo">2666</span> clearRangeMarkers(key);<a name="line.2666"></a>
- <span class="sourceLineNo">2667</span> }<a name="line.2667"></a>
- <span class="sourceLineNo">2668</span> this.backgroundRangeMarkers.clear();<a name="line.2668"></a>
- <span class="sourceLineNo">2669</span> }<a name="line.2669"></a>
- <span class="sourceLineNo">2670</span> if (this.foregroundRangeMarkers != null) {<a name="line.2670"></a>
- <span class="sourceLineNo">2671</span> Set<Integer> keys = this.foregroundRangeMarkers.keySet();<a name="line.2671"></a>
- <span class="sourceLineNo">2672</span> for (Integer key : keys) {<a name="line.2672"></a>
- <span class="sourceLineNo">2673</span> clearRangeMarkers(key);<a name="line.2673"></a>
- <span class="sourceLineNo">2674</span> }<a name="line.2674"></a>
- <span class="sourceLineNo">2675</span> this.foregroundRangeMarkers.clear();<a name="line.2675"></a>
- <span class="sourceLineNo">2676</span> }<a name="line.2676"></a>
- <span class="sourceLineNo">2677</span> fireChangeEvent();<a name="line.2677"></a>
- <span class="sourceLineNo">2678</span> }<a name="line.2678"></a>
- <span class="sourceLineNo">2679</span><a name="line.2679"></a>
- <span class="sourceLineNo">2680</span> /**<a name="line.2680"></a>
- <span class="sourceLineNo">2681</span> * Adds a marker for a specific dataset/renderer and sends a<a name="line.2681"></a>
- <span class="sourceLineNo">2682</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2682"></a>
- <span class="sourceLineNo">2683</span> * <P><a name="line.2683"></a>
- <span class="sourceLineNo">2684</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2684"></a>
- <span class="sourceLineNo">2685</span> * to the range axis, however this is entirely up to the renderer.<a name="line.2685"></a>
- <span class="sourceLineNo">2686</span> *<a name="line.2686"></a>
- <span class="sourceLineNo">2687</span> * @param index the dataset/renderer index.<a name="line.2687"></a>
- <span class="sourceLineNo">2688</span> * @param marker the marker.<a name="line.2688"></a>
- <span class="sourceLineNo">2689</span> * @param layer the layer (foreground or background).<a name="line.2689"></a>
- <span class="sourceLineNo">2690</span> *<a name="line.2690"></a>
- <span class="sourceLineNo">2691</span> * @see #clearRangeMarkers(int)<a name="line.2691"></a>
- <span class="sourceLineNo">2692</span> * @see #addDomainMarker(int, Marker, Layer)<a name="line.2692"></a>
- <span class="sourceLineNo">2693</span> */<a name="line.2693"></a>
- <span class="sourceLineNo">2694</span> public void addRangeMarker(int index, Marker marker, Layer layer) {<a name="line.2694"></a>
- <span class="sourceLineNo">2695</span> addRangeMarker(index, marker, layer, true);<a name="line.2695"></a>
- <span class="sourceLineNo">2696</span> }<a name="line.2696"></a>
- <span class="sourceLineNo">2697</span><a name="line.2697"></a>
- <span class="sourceLineNo">2698</span> /**<a name="line.2698"></a>
- <span class="sourceLineNo">2699</span> * Adds a marker for a specific dataset/renderer and, if requested, sends a<a name="line.2699"></a>
- <span class="sourceLineNo">2700</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2700"></a>
- <span class="sourceLineNo">2701</span> * <P><a name="line.2701"></a>
- <span class="sourceLineNo">2702</span> * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2702"></a>
- <span class="sourceLineNo">2703</span> * to the range axis, however this is entirely up to the renderer.<a name="line.2703"></a>
- <span class="sourceLineNo">2704</span> *<a name="line.2704"></a>
- <span class="sourceLineNo">2705</span> * @param index the dataset/renderer index.<a name="line.2705"></a>
- <span class="sourceLineNo">2706</span> * @param marker the marker.<a name="line.2706"></a>
- <span class="sourceLineNo">2707</span> * @param layer the layer (foreground or background).<a name="line.2707"></a>
- <span class="sourceLineNo">2708</span> * @param notify notify listeners?<a name="line.2708"></a>
- <span class="sourceLineNo">2709</span> *<a name="line.2709"></a>
- <span class="sourceLineNo">2710</span> * @since 1.0.10<a name="line.2710"></a>
- <span class="sourceLineNo">2711</span> */<a name="line.2711"></a>
- <span class="sourceLineNo">2712</span> public void addRangeMarker(int index, Marker marker, Layer layer,<a name="line.2712"></a>
- <span class="sourceLineNo">2713</span> boolean notify) {<a name="line.2713"></a>
- <span class="sourceLineNo">2714</span> Collection markers;<a name="line.2714"></a>
- <span class="sourceLineNo">2715</span> if (layer == Layer.FOREGROUND) {<a name="line.2715"></a>
- <span class="sourceLineNo">2716</span> markers = (Collection) this.foregroundRangeMarkers.get(<a name="line.2716"></a>
- <span class="sourceLineNo">2717</span> new Integer(index));<a name="line.2717"></a>
- <span class="sourceLineNo">2718</span> if (markers == null) {<a name="line.2718"></a>
- <span class="sourceLineNo">2719</span> markers = new java.util.ArrayList();<a name="line.2719"></a>
- <span class="sourceLineNo">2720</span> this.foregroundRangeMarkers.put(new Integer(index), markers);<a name="line.2720"></a>
- <span class="sourceLineNo">2721</span> }<a name="line.2721"></a>
- <span class="sourceLineNo">2722</span> markers.add(marker);<a name="line.2722"></a>
- <span class="sourceLineNo">2723</span> }<a name="line.2723"></a>
- <span class="sourceLineNo">2724</span> else if (layer == Layer.BACKGROUND) {<a name="line.2724"></a>
- <span class="sourceLineNo">2725</span> markers = (Collection) this.backgroundRangeMarkers.get(<a name="line.2725"></a>
- <span class="sourceLineNo">2726</span> new Integer(index));<a name="line.2726"></a>
- <span class="sourceLineNo">2727</span> if (markers == null) {<a name="line.2727"></a>
- <span class="sourceLineNo">2728</span> markers = new java.util.ArrayList();<a name="line.2728"></a>
- <span class="sourceLineNo">2729</span> this.backgroundRangeMarkers.put(new Integer(index), markers);<a name="line.2729"></a>
- <span class="sourceLineNo">2730</span> }<a name="line.2730"></a>
- <span class="sourceLineNo">2731</span> markers.add(marker);<a name="line.2731"></a>
- <span class="sourceLineNo">2732</span> }<a name="line.2732"></a>
- <span class="sourceLineNo">2733</span> marker.addChangeListener(this);<a name="line.2733"></a>
- <span class="sourceLineNo">2734</span> if (notify) {<a name="line.2734"></a>
- <span class="sourceLineNo">2735</span> fireChangeEvent();<a name="line.2735"></a>
- <span class="sourceLineNo">2736</span> }<a name="line.2736"></a>
- <span class="sourceLineNo">2737</span> }<a name="line.2737"></a>
- <span class="sourceLineNo">2738</span><a name="line.2738"></a>
- <span class="sourceLineNo">2739</span> /**<a name="line.2739"></a>
- <span class="sourceLineNo">2740</span> * Clears the (foreground and background) range markers for a particular<a name="line.2740"></a>
- <span class="sourceLineNo">2741</span> * renderer.<a name="line.2741"></a>
- <span class="sourceLineNo">2742</span> *<a name="line.2742"></a>
- <span class="sourceLineNo">2743</span> * @param index the renderer index.<a name="line.2743"></a>
- <span class="sourceLineNo">2744</span> */<a name="line.2744"></a>
- <span class="sourceLineNo">2745</span> public void clearRangeMarkers(int index) {<a name="line.2745"></a>
- <span class="sourceLineNo">2746</span> Integer key = new Integer(index);<a name="line.2746"></a>
- <span class="sourceLineNo">2747</span> if (this.backgroundRangeMarkers != null) {<a name="line.2747"></a>
- <span class="sourceLineNo">2748</span> Collection markers<a name="line.2748"></a>
- <span class="sourceLineNo">2749</span> = (Collection) this.backgroundRangeMarkers.get(key);<a name="line.2749"></a>
- <span class="sourceLineNo">2750</span> if (markers != null) {<a name="line.2750"></a>
- <span class="sourceLineNo">2751</span> Iterator iterator = markers.iterator();<a name="line.2751"></a>
- <span class="sourceLineNo">2752</span> while (iterator.hasNext()) {<a name="line.2752"></a>
- <span class="sourceLineNo">2753</span> Marker m = (Marker) iterator.next();<a name="line.2753"></a>
- <span class="sourceLineNo">2754</span> m.removeChangeListener(this);<a name="line.2754"></a>
- <span class="sourceLineNo">2755</span> }<a name="line.2755"></a>
- <span class="sourceLineNo">2756</span> markers.clear();<a name="line.2756"></a>
- <span class="sourceLineNo">2757</span> }<a name="line.2757"></a>
- <span class="sourceLineNo">2758</span> }<a name="line.2758"></a>
- <span class="sourceLineNo">2759</span> if (this.foregroundRangeMarkers != null) {<a name="line.2759"></a>
- <span class="sourceLineNo">2760</span> Collection markers<a name="line.2760"></a>
- <span class="sourceLineNo">2761</span> = (Collection) this.foregroundRangeMarkers.get(key);<a name="line.2761"></a>
- <span class="sourceLineNo">2762</span> if (markers != null) {<a name="line.2762"></a>
- <span class="sourceLineNo">2763</span> Iterator iterator = markers.iterator();<a name="line.2763"></a>
- <span class="sourceLineNo">2764</span> while (iterator.hasNext()) {<a name="line.2764"></a>
- <span class="sourceLineNo">2765</span> Marker m = (Marker) iterator.next();<a name="line.2765"></a>
- <span class="sourceLineNo">2766</span> m.removeChangeListener(this);<a name="line.2766"></a>
- <span class="sourceLineNo">2767</span> }<a name="line.2767"></a>
- <span class="sourceLineNo">2768</span> markers.clear();<a name="line.2768"></a>
- <span class="sourceLineNo">2769</span> }<a name="line.2769"></a>
- <span class="sourceLineNo">2770</span> }<a name="line.2770"></a>
- <span class="sourceLineNo">2771</span> fireChangeEvent();<a name="line.2771"></a>
- <span class="sourceLineNo">2772</span> }<a name="line.2772"></a>
- <span class="sourceLineNo">2773</span><a name="line.2773"></a>
- <span class="sourceLineNo">2774</span> /**<a name="line.2774"></a>
- <span class="sourceLineNo">2775</span> * Removes a marker for the range axis and sends a {@link PlotChangeEvent}<a name="line.2775"></a>
- <span class="sourceLineNo">2776</span> * to all registered listeners.<a name="line.2776"></a>
- <span class="sourceLineNo">2777</span> *<a name="line.2777"></a>
- <span class="sourceLineNo">2778</span> * @param marker the marker.<a name="line.2778"></a>
- <span class="sourceLineNo">2779</span> *<a name="line.2779"></a>
- <span class="sourceLineNo">2780</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2780"></a>
- <span class="sourceLineNo">2781</span> * removed.<a name="line.2781"></a>
- <span class="sourceLineNo">2782</span> *<a name="line.2782"></a>
- <span class="sourceLineNo">2783</span> * @since 1.0.7<a name="line.2783"></a>
- <span class="sourceLineNo">2784</span> */<a name="line.2784"></a>
- <span class="sourceLineNo">2785</span> public boolean removeRangeMarker(Marker marker) {<a name="line.2785"></a>
- <span class="sourceLineNo">2786</span> return removeRangeMarker(marker, Layer.FOREGROUND);<a name="line.2786"></a>
- <span class="sourceLineNo">2787</span> }<a name="line.2787"></a>
- <span class="sourceLineNo">2788</span><a name="line.2788"></a>
- <span class="sourceLineNo">2789</span> /**<a name="line.2789"></a>
- <span class="sourceLineNo">2790</span> * Removes a marker for the range axis in the specified layer and sends a<a name="line.2790"></a>
- <span class="sourceLineNo">2791</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2791"></a>
- <span class="sourceLineNo">2792</span> *<a name="line.2792"></a>
- <span class="sourceLineNo">2793</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2793"></a>
- <span class="sourceLineNo">2794</span> * @param layer the layer (foreground or background).<a name="line.2794"></a>
- <span class="sourceLineNo">2795</span> *<a name="line.2795"></a>
- <span class="sourceLineNo">2796</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2796"></a>
- <span class="sourceLineNo">2797</span> * removed.<a name="line.2797"></a>
- <span class="sourceLineNo">2798</span> *<a name="line.2798"></a>
- <span class="sourceLineNo">2799</span> * @since 1.0.7<a name="line.2799"></a>
- <span class="sourceLineNo">2800</span> */<a name="line.2800"></a>
- <span class="sourceLineNo">2801</span> public boolean removeRangeMarker(Marker marker, Layer layer) {<a name="line.2801"></a>
- <span class="sourceLineNo">2802</span> return removeRangeMarker(0, marker, layer);<a name="line.2802"></a>
- <span class="sourceLineNo">2803</span> }<a name="line.2803"></a>
- <span class="sourceLineNo">2804</span><a name="line.2804"></a>
- <span class="sourceLineNo">2805</span> /**<a name="line.2805"></a>
- <span class="sourceLineNo">2806</span> * Removes a marker for a specific dataset/renderer and sends a<a name="line.2806"></a>
- <span class="sourceLineNo">2807</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2807"></a>
- <span class="sourceLineNo">2808</span> *<a name="line.2808"></a>
- <span class="sourceLineNo">2809</span> * @param index the dataset/renderer index.<a name="line.2809"></a>
- <span class="sourceLineNo">2810</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2810"></a>
- <span class="sourceLineNo">2811</span> * @param layer the layer (foreground or background).<a name="line.2811"></a>
- <span class="sourceLineNo">2812</span> *<a name="line.2812"></a>
- <span class="sourceLineNo">2813</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2813"></a>
- <span class="sourceLineNo">2814</span> * removed.<a name="line.2814"></a>
- <span class="sourceLineNo">2815</span> *<a name="line.2815"></a>
- <span class="sourceLineNo">2816</span> * @since 1.0.7<a name="line.2816"></a>
- <span class="sourceLineNo">2817</span> */<a name="line.2817"></a>
- <span class="sourceLineNo">2818</span> public boolean removeRangeMarker(int index, Marker marker, Layer layer) {<a name="line.2818"></a>
- <span class="sourceLineNo">2819</span> return removeRangeMarker(index, marker, layer, true);<a name="line.2819"></a>
- <span class="sourceLineNo">2820</span> }<a name="line.2820"></a>
- <span class="sourceLineNo">2821</span><a name="line.2821"></a>
- <span class="sourceLineNo">2822</span> /**<a name="line.2822"></a>
- <span class="sourceLineNo">2823</span> * Removes a marker for a specific dataset/renderer and sends a<a name="line.2823"></a>
- <span class="sourceLineNo">2824</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2824"></a>
- <span class="sourceLineNo">2825</span> *<a name="line.2825"></a>
- <span class="sourceLineNo">2826</span> * @param index the dataset/renderer index.<a name="line.2826"></a>
- <span class="sourceLineNo">2827</span> * @param marker the marker (<code>null</code> not permitted).<a name="line.2827"></a>
- <span class="sourceLineNo">2828</span> * @param layer the layer (foreground or background) (<code>null</code> not permitted).<a name="line.2828"></a>
- <span class="sourceLineNo">2829</span> * @param notify notify listeners?<a name="line.2829"></a>
- <span class="sourceLineNo">2830</span> *<a name="line.2830"></a>
- <span class="sourceLineNo">2831</span> * @return A boolean indicating whether or not the marker was actually<a name="line.2831"></a>
- <span class="sourceLineNo">2832</span> * removed.<a name="line.2832"></a>
- <span class="sourceLineNo">2833</span> *<a name="line.2833"></a>
- <span class="sourceLineNo">2834</span> * @since 1.0.10<a name="line.2834"></a>
- <span class="sourceLineNo">2835</span> */<a name="line.2835"></a>
- <span class="sourceLineNo">2836</span> public boolean removeRangeMarker(int index, Marker marker, Layer layer,<a name="line.2836"></a>
- <span class="sourceLineNo">2837</span> boolean notify) {<a name="line.2837"></a>
- <span class="sourceLineNo">2838</span> ParamChecks.nullNotPermitted(marker, "marker");<a name="line.2838"></a>
- <span class="sourceLineNo">2839</span> ParamChecks.nullNotPermitted(layer, "layer");<a name="line.2839"></a>
- <span class="sourceLineNo">2840</span> List markers;<a name="line.2840"></a>
- <span class="sourceLineNo">2841</span> if (layer == Layer.FOREGROUND) {<a name="line.2841"></a>
- <span class="sourceLineNo">2842</span> markers = (List) this.foregroundRangeMarkers.get(<a name="line.2842"></a>
- <span class="sourceLineNo">2843</span> new Integer(index));<a name="line.2843"></a>
- <span class="sourceLineNo">2844</span> }<a name="line.2844"></a>
- <span class="sourceLineNo">2845</span> else {<a name="line.2845"></a>
- <span class="sourceLineNo">2846</span> markers = (List) this.backgroundRangeMarkers.get(<a name="line.2846"></a>
- <span class="sourceLineNo">2847</span> new Integer(index));<a name="line.2847"></a>
- <span class="sourceLineNo">2848</span> }<a name="line.2848"></a>
- <span class="sourceLineNo">2849</span> if (markers == null) {<a name="line.2849"></a>
- <span class="sourceLineNo">2850</span> return false;<a name="line.2850"></a>
- <span class="sourceLineNo">2851</span> }<a name="line.2851"></a>
- <span class="sourceLineNo">2852</span> boolean removed = markers.remove(marker);<a name="line.2852"></a>
- <span class="sourceLineNo">2853</span> if (removed && notify) {<a name="line.2853"></a>
- <span class="sourceLineNo">2854</span> fireChangeEvent();<a name="line.2854"></a>
- <span class="sourceLineNo">2855</span> }<a name="line.2855"></a>
- <span class="sourceLineNo">2856</span> return removed;<a name="line.2856"></a>
- <span class="sourceLineNo">2857</span> }<a name="line.2857"></a>
- <span class="sourceLineNo">2858</span><a name="line.2858"></a>
- <span class="sourceLineNo">2859</span> /**<a name="line.2859"></a>
- <span class="sourceLineNo">2860</span> * Adds an annotation to the plot and sends a {@link PlotChangeEvent} to<a name="line.2860"></a>
- <span class="sourceLineNo">2861</span> * all registered listeners.<a name="line.2861"></a>
- <span class="sourceLineNo">2862</span> *<a name="line.2862"></a>
- <span class="sourceLineNo">2863</span> * @param annotation the annotation (<code>null</code> not permitted).<a name="line.2863"></a>
- <span class="sourceLineNo">2864</span> *<a name="line.2864"></a>
- <span class="sourceLineNo">2865</span> * @see #getAnnotations()<a name="line.2865"></a>
- <span class="sourceLineNo">2866</span> * @see #removeAnnotation(XYAnnotation)<a name="line.2866"></a>
- <span class="sourceLineNo">2867</span> */<a name="line.2867"></a>
- <span class="sourceLineNo">2868</span> public void addAnnotation(XYAnnotation annotation) {<a name="line.2868"></a>
- <span class="sourceLineNo">2869</span> addAnnotation(annotation, true);<a name="line.2869"></a>
- <span class="sourceLineNo">2870</span> }<a name="line.2870"></a>
- <span class="sourceLineNo">2871</span><a name="line.2871"></a>
- <span class="sourceLineNo">2872</span> /**<a name="line.2872"></a>
- <span class="sourceLineNo">2873</span> * Adds an annotation to the plot and, if requested, sends a<a name="line.2873"></a>
- <span class="sourceLineNo">2874</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2874"></a>
- <span class="sourceLineNo">2875</span> *<a name="line.2875"></a>
- <span class="sourceLineNo">2876</span> * @param annotation the annotation (<code>null</code> not permitted).<a name="line.2876"></a>
- <span class="sourceLineNo">2877</span> * @param notify notify listeners?<a name="line.2877"></a>
- <span class="sourceLineNo">2878</span> *<a name="line.2878"></a>
- <span class="sourceLineNo">2879</span> * @since 1.0.10<a name="line.2879"></a>
- <span class="sourceLineNo">2880</span> */<a name="line.2880"></a>
- <span class="sourceLineNo">2881</span> public void addAnnotation(XYAnnotation annotation, boolean notify) {<a name="line.2881"></a>
- <span class="sourceLineNo">2882</span> ParamChecks.nullNotPermitted(annotation, "annotation");<a name="line.2882"></a>
- <span class="sourceLineNo">2883</span> this.annotations.add(annotation);<a name="line.2883"></a>
- <span class="sourceLineNo">2884</span> annotation.addChangeListener(this);<a name="line.2884"></a>
- <span class="sourceLineNo">2885</span> if (notify) {<a name="line.2885"></a>
- <span class="sourceLineNo">2886</span> fireChangeEvent();<a name="line.2886"></a>
- <span class="sourceLineNo">2887</span> }<a name="line.2887"></a>
- <span class="sourceLineNo">2888</span> }<a name="line.2888"></a>
- <span class="sourceLineNo">2889</span><a name="line.2889"></a>
- <span class="sourceLineNo">2890</span> /**<a name="line.2890"></a>
- <span class="sourceLineNo">2891</span> * Removes an annotation from the plot and sends a {@link PlotChangeEvent}<a name="line.2891"></a>
- <span class="sourceLineNo">2892</span> * to all registered listeners.<a name="line.2892"></a>
- <span class="sourceLineNo">2893</span> *<a name="line.2893"></a>
- <span class="sourceLineNo">2894</span> * @param annotation the annotation (<code>null</code> not permitted).<a name="line.2894"></a>
- <span class="sourceLineNo">2895</span> *<a name="line.2895"></a>
- <span class="sourceLineNo">2896</span> * @return A boolean (indicates whether or not the annotation was removed).<a name="line.2896"></a>
- <span class="sourceLineNo">2897</span> *<a name="line.2897"></a>
- <span class="sourceLineNo">2898</span> * @see #addAnnotation(XYAnnotation)<a name="line.2898"></a>
- <span class="sourceLineNo">2899</span> * @see #getAnnotations()<a name="line.2899"></a>
- <span class="sourceLineNo">2900</span> */<a name="line.2900"></a>
- <span class="sourceLineNo">2901</span> public boolean removeAnnotation(XYAnnotation annotation) {<a name="line.2901"></a>
- <span class="sourceLineNo">2902</span> return removeAnnotation(annotation, true);<a name="line.2902"></a>
- <span class="sourceLineNo">2903</span> }<a name="line.2903"></a>
- <span class="sourceLineNo">2904</span><a name="line.2904"></a>
- <span class="sourceLineNo">2905</span> /**<a name="line.2905"></a>
- <span class="sourceLineNo">2906</span> * Removes an annotation from the plot and sends a {@link PlotChangeEvent}<a name="line.2906"></a>
- <span class="sourceLineNo">2907</span> * to all registered listeners.<a name="line.2907"></a>
- <span class="sourceLineNo">2908</span> *<a name="line.2908"></a>
- <span class="sourceLineNo">2909</span> * @param annotation the annotation (<code>null</code> not permitted).<a name="line.2909"></a>
- <span class="sourceLineNo">2910</span> * @param notify notify listeners?<a name="line.2910"></a>
- <span class="sourceLineNo">2911</span> *<a name="line.2911"></a>
- <span class="sourceLineNo">2912</span> * @return A boolean (indicates whether or not the annotation was removed).<a name="line.2912"></a>
- <span class="sourceLineNo">2913</span> *<a name="line.2913"></a>
- <span class="sourceLineNo">2914</span> * @since 1.0.10<a name="line.2914"></a>
- <span class="sourceLineNo">2915</span> */<a name="line.2915"></a>
- <span class="sourceLineNo">2916</span> public boolean removeAnnotation(XYAnnotation annotation, boolean notify) {<a name="line.2916"></a>
- <span class="sourceLineNo">2917</span> ParamChecks.nullNotPermitted(annotation, "annotation");<a name="line.2917"></a>
- <span class="sourceLineNo">2918</span> boolean removed = this.annotations.remove(annotation);<a name="line.2918"></a>
- <span class="sourceLineNo">2919</span> annotation.removeChangeListener(this);<a name="line.2919"></a>
- <span class="sourceLineNo">2920</span> if (removed && notify) {<a name="line.2920"></a>
- <span class="sourceLineNo">2921</span> fireChangeEvent();<a name="line.2921"></a>
- <span class="sourceLineNo">2922</span> }<a name="line.2922"></a>
- <span class="sourceLineNo">2923</span> return removed;<a name="line.2923"></a>
- <span class="sourceLineNo">2924</span> }<a name="line.2924"></a>
- <span class="sourceLineNo">2925</span><a name="line.2925"></a>
- <span class="sourceLineNo">2926</span> /**<a name="line.2926"></a>
- <span class="sourceLineNo">2927</span> * Returns the list of annotations.<a name="line.2927"></a>
- <span class="sourceLineNo">2928</span> *<a name="line.2928"></a>
- <span class="sourceLineNo">2929</span> * @return The list of annotations.<a name="line.2929"></a>
- <span class="sourceLineNo">2930</span> *<a name="line.2930"></a>
- <span class="sourceLineNo">2931</span> * @since 1.0.1<a name="line.2931"></a>
- <span class="sourceLineNo">2932</span> *<a name="line.2932"></a>
- <span class="sourceLineNo">2933</span> * @see #addAnnotation(XYAnnotation)<a name="line.2933"></a>
- <span class="sourceLineNo">2934</span> */<a name="line.2934"></a>
- <span class="sourceLineNo">2935</span> public List getAnnotations() {<a name="line.2935"></a>
- <span class="sourceLineNo">2936</span> return new ArrayList(this.annotations);<a name="line.2936"></a>
- <span class="sourceLineNo">2937</span> }<a name="line.2937"></a>
- <span class="sourceLineNo">2938</span><a name="line.2938"></a>
- <span class="sourceLineNo">2939</span> /**<a name="line.2939"></a>
- <span class="sourceLineNo">2940</span> * Clears all the annotations and sends a {@link PlotChangeEvent} to all<a name="line.2940"></a>
- <span class="sourceLineNo">2941</span> * registered listeners.<a name="line.2941"></a>
- <span class="sourceLineNo">2942</span> *<a name="line.2942"></a>
- <span class="sourceLineNo">2943</span> * @see #addAnnotation(XYAnnotation)<a name="line.2943"></a>
- <span class="sourceLineNo">2944</span> */<a name="line.2944"></a>
- <span class="sourceLineNo">2945</span> public void clearAnnotations() {<a name="line.2945"></a>
- <span class="sourceLineNo">2946</span> for (XYAnnotation annotation : this.annotations) {<a name="line.2946"></a>
- <span class="sourceLineNo">2947</span> annotation.removeChangeListener(this);<a name="line.2947"></a>
- <span class="sourceLineNo">2948</span> }<a name="line.2948"></a>
- <span class="sourceLineNo">2949</span> this.annotations.clear();<a name="line.2949"></a>
- <span class="sourceLineNo">2950</span> fireChangeEvent();<a name="line.2950"></a>
- <span class="sourceLineNo">2951</span> }<a name="line.2951"></a>
- <span class="sourceLineNo">2952</span><a name="line.2952"></a>
- <span class="sourceLineNo">2953</span> /**<a name="line.2953"></a>
- <span class="sourceLineNo">2954</span> * Returns the shadow generator for the plot, if any.<a name="line.2954"></a>
- <span class="sourceLineNo">2955</span> *<a name="line.2955"></a>
- <span class="sourceLineNo">2956</span> * @return The shadow generator (possibly <code>null</code>).<a name="line.2956"></a>
- <span class="sourceLineNo">2957</span> *<a name="line.2957"></a>
- <span class="sourceLineNo">2958</span> * @since 1.0.14<a name="line.2958"></a>
- <span class="sourceLineNo">2959</span> */<a name="line.2959"></a>
- <span class="sourceLineNo">2960</span> public ShadowGenerator getShadowGenerator() {<a name="line.2960"></a>
- <span class="sourceLineNo">2961</span> return this.shadowGenerator;<a name="line.2961"></a>
- <span class="sourceLineNo">2962</span> }<a name="line.2962"></a>
- <span class="sourceLineNo">2963</span><a name="line.2963"></a>
- <span class="sourceLineNo">2964</span> /**<a name="line.2964"></a>
- <span class="sourceLineNo">2965</span> * Sets the shadow generator for the plot and sends a<a name="line.2965"></a>
- <span class="sourceLineNo">2966</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.2966"></a>
- <span class="sourceLineNo">2967</span> *<a name="line.2967"></a>
- <span class="sourceLineNo">2968</span> * @param generator the generator (<code>null</code> permitted).<a name="line.2968"></a>
- <span class="sourceLineNo">2969</span> *<a name="line.2969"></a>
- <span class="sourceLineNo">2970</span> * @since 1.0.14<a name="line.2970"></a>
- <span class="sourceLineNo">2971</span> */<a name="line.2971"></a>
- <span class="sourceLineNo">2972</span> public void setShadowGenerator(ShadowGenerator generator) {<a name="line.2972"></a>
- <span class="sourceLineNo">2973</span> this.shadowGenerator = generator;<a name="line.2973"></a>
- <span class="sourceLineNo">2974</span> fireChangeEvent();<a name="line.2974"></a>
- <span class="sourceLineNo">2975</span> }<a name="line.2975"></a>
- <span class="sourceLineNo">2976</span><a name="line.2976"></a>
- <span class="sourceLineNo">2977</span> /**<a name="line.2977"></a>
- <span class="sourceLineNo">2978</span> * Calculates the space required for all the axes in the plot.<a name="line.2978"></a>
- <span class="sourceLineNo">2979</span> *<a name="line.2979"></a>
- <span class="sourceLineNo">2980</span> * @param g2 the graphics device.<a name="line.2980"></a>
- <span class="sourceLineNo">2981</span> * @param plotArea the plot area.<a name="line.2981"></a>
- <span class="sourceLineNo">2982</span> *<a name="line.2982"></a>
- <span class="sourceLineNo">2983</span> * @return The required space.<a name="line.2983"></a>
- <span class="sourceLineNo">2984</span> */<a name="line.2984"></a>
- <span class="sourceLineNo">2985</span> protected AxisSpace calculateAxisSpace(Graphics2D g2,<a name="line.2985"></a>
- <span class="sourceLineNo">2986</span> Rectangle2D plotArea) {<a name="line.2986"></a>
- <span class="sourceLineNo">2987</span> AxisSpace space = new AxisSpace();<a name="line.2987"></a>
- <span class="sourceLineNo">2988</span> space = calculateRangeAxisSpace(g2, plotArea, space);<a name="line.2988"></a>
- <span class="sourceLineNo">2989</span> Rectangle2D revPlotArea = space.shrink(plotArea, null);<a name="line.2989"></a>
- <span class="sourceLineNo">2990</span> space = calculateDomainAxisSpace(g2, revPlotArea, space);<a name="line.2990"></a>
- <span class="sourceLineNo">2991</span> return space;<a name="line.2991"></a>
- <span class="sourceLineNo">2992</span> }<a name="line.2992"></a>
- <span class="sourceLineNo">2993</span><a name="line.2993"></a>
- <span class="sourceLineNo">2994</span> /**<a name="line.2994"></a>
- <span class="sourceLineNo">2995</span> * Calculates the space required for the domain axis/axes.<a name="line.2995"></a>
- <span class="sourceLineNo">2996</span> *<a name="line.2996"></a>
- <span class="sourceLineNo">2997</span> * @param g2 the graphics device.<a name="line.2997"></a>
- <span class="sourceLineNo">2998</span> * @param plotArea the plot area.<a name="line.2998"></a>
- <span class="sourceLineNo">2999</span> * @param space a carrier for the result (<code>null</code> permitted).<a name="line.2999"></a>
- <span class="sourceLineNo">3000</span> *<a name="line.3000"></a>
- <span class="sourceLineNo">3001</span> * @return The required space.<a name="line.3001"></a>
- <span class="sourceLineNo">3002</span> */<a name="line.3002"></a>
- <span class="sourceLineNo">3003</span> protected AxisSpace calculateDomainAxisSpace(Graphics2D g2, <a name="line.3003"></a>
- <span class="sourceLineNo">3004</span> Rectangle2D plotArea, AxisSpace space) {<a name="line.3004"></a>
- <span class="sourceLineNo">3005</span><a name="line.3005"></a>
- <span class="sourceLineNo">3006</span> if (space == null) {<a name="line.3006"></a>
- <span class="sourceLineNo">3007</span> space = new AxisSpace();<a name="line.3007"></a>
- <span class="sourceLineNo">3008</span> }<a name="line.3008"></a>
- <span class="sourceLineNo">3009</span><a name="line.3009"></a>
- <span class="sourceLineNo">3010</span> // reserve some space for the domain axis...<a name="line.3010"></a>
- <span class="sourceLineNo">3011</span> if (this.fixedDomainAxisSpace != null) {<a name="line.3011"></a>
- <span class="sourceLineNo">3012</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3012"></a>
- <span class="sourceLineNo">3013</span> space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(),<a name="line.3013"></a>
- <span class="sourceLineNo">3014</span> RectangleEdge.LEFT);<a name="line.3014"></a>
- <span class="sourceLineNo">3015</span> space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(),<a name="line.3015"></a>
- <span class="sourceLineNo">3016</span> RectangleEdge.RIGHT);<a name="line.3016"></a>
- <span class="sourceLineNo">3017</span> }<a name="line.3017"></a>
- <span class="sourceLineNo">3018</span> else if (this.orientation == PlotOrientation.VERTICAL) {<a name="line.3018"></a>
- <span class="sourceLineNo">3019</span> space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(),<a name="line.3019"></a>
- <span class="sourceLineNo">3020</span> RectangleEdge.TOP);<a name="line.3020"></a>
- <span class="sourceLineNo">3021</span> space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(),<a name="line.3021"></a>
- <span class="sourceLineNo">3022</span> RectangleEdge.BOTTOM);<a name="line.3022"></a>
- <span class="sourceLineNo">3023</span> }<a name="line.3023"></a>
- <span class="sourceLineNo">3024</span> }<a name="line.3024"></a>
- <span class="sourceLineNo">3025</span> else {<a name="line.3025"></a>
- <span class="sourceLineNo">3026</span> // reserve space for the domain axes...<a name="line.3026"></a>
- <span class="sourceLineNo">3027</span> for (ValueAxis axis: this.domainAxes.values()) {<a name="line.3027"></a>
- <span class="sourceLineNo">3028</span> if (axis != null) {<a name="line.3028"></a>
- <span class="sourceLineNo">3029</span> RectangleEdge edge = getDomainAxisEdge(<a name="line.3029"></a>
- <span class="sourceLineNo">3030</span> findDomainAxisIndex(axis));<a name="line.3030"></a>
- <span class="sourceLineNo">3031</span> space = axis.reserveSpace(g2, this, plotArea, edge, space);<a name="line.3031"></a>
- <span class="sourceLineNo">3032</span> }<a name="line.3032"></a>
- <span class="sourceLineNo">3033</span> }<a name="line.3033"></a>
- <span class="sourceLineNo">3034</span> }<a name="line.3034"></a>
- <span class="sourceLineNo">3035</span><a name="line.3035"></a>
- <span class="sourceLineNo">3036</span> return space;<a name="line.3036"></a>
- <span class="sourceLineNo">3037</span><a name="line.3037"></a>
- <span class="sourceLineNo">3038</span> }<a name="line.3038"></a>
- <span class="sourceLineNo">3039</span><a name="line.3039"></a>
- <span class="sourceLineNo">3040</span> /**<a name="line.3040"></a>
- <span class="sourceLineNo">3041</span> * Calculates the space required for the range axis/axes.<a name="line.3041"></a>
- <span class="sourceLineNo">3042</span> *<a name="line.3042"></a>
- <span class="sourceLineNo">3043</span> * @param g2 the graphics device.<a name="line.3043"></a>
- <span class="sourceLineNo">3044</span> * @param plotArea the plot area.<a name="line.3044"></a>
- <span class="sourceLineNo">3045</span> * @param space a carrier for the result (<code>null</code> permitted).<a name="line.3045"></a>
- <span class="sourceLineNo">3046</span> *<a name="line.3046"></a>
- <span class="sourceLineNo">3047</span> * @return The required space.<a name="line.3047"></a>
- <span class="sourceLineNo">3048</span> */<a name="line.3048"></a>
- <span class="sourceLineNo">3049</span> protected AxisSpace calculateRangeAxisSpace(Graphics2D g2, <a name="line.3049"></a>
- <span class="sourceLineNo">3050</span> Rectangle2D plotArea, AxisSpace space) {<a name="line.3050"></a>
- <span class="sourceLineNo">3051</span><a name="line.3051"></a>
- <span class="sourceLineNo">3052</span> if (space == null) {<a name="line.3052"></a>
- <span class="sourceLineNo">3053</span> space = new AxisSpace();<a name="line.3053"></a>
- <span class="sourceLineNo">3054</span> }<a name="line.3054"></a>
- <span class="sourceLineNo">3055</span><a name="line.3055"></a>
- <span class="sourceLineNo">3056</span> // reserve some space for the range axis...<a name="line.3056"></a>
- <span class="sourceLineNo">3057</span> if (this.fixedRangeAxisSpace != null) {<a name="line.3057"></a>
- <span class="sourceLineNo">3058</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3058"></a>
- <span class="sourceLineNo">3059</span> space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(),<a name="line.3059"></a>
- <span class="sourceLineNo">3060</span> RectangleEdge.TOP);<a name="line.3060"></a>
- <span class="sourceLineNo">3061</span> space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(),<a name="line.3061"></a>
- <span class="sourceLineNo">3062</span> RectangleEdge.BOTTOM);<a name="line.3062"></a>
- <span class="sourceLineNo">3063</span> }<a name="line.3063"></a>
- <span class="sourceLineNo">3064</span> else if (this.orientation == PlotOrientation.VERTICAL) {<a name="line.3064"></a>
- <span class="sourceLineNo">3065</span> space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(),<a name="line.3065"></a>
- <span class="sourceLineNo">3066</span> RectangleEdge.LEFT);<a name="line.3066"></a>
- <span class="sourceLineNo">3067</span> space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(),<a name="line.3067"></a>
- <span class="sourceLineNo">3068</span> RectangleEdge.RIGHT);<a name="line.3068"></a>
- <span class="sourceLineNo">3069</span> }<a name="line.3069"></a>
- <span class="sourceLineNo">3070</span> }<a name="line.3070"></a>
- <span class="sourceLineNo">3071</span> else {<a name="line.3071"></a>
- <span class="sourceLineNo">3072</span> // reserve space for the range axes...<a name="line.3072"></a>
- <span class="sourceLineNo">3073</span> for (ValueAxis axis: this.rangeAxes.values()) {<a name="line.3073"></a>
- <span class="sourceLineNo">3074</span> if (axis != null) {<a name="line.3074"></a>
- <span class="sourceLineNo">3075</span> RectangleEdge edge = getRangeAxisEdge(<a name="line.3075"></a>
- <span class="sourceLineNo">3076</span> findRangeAxisIndex(axis));<a name="line.3076"></a>
- <span class="sourceLineNo">3077</span> space = axis.reserveSpace(g2, this, plotArea, edge, space);<a name="line.3077"></a>
- <span class="sourceLineNo">3078</span> }<a name="line.3078"></a>
- <span class="sourceLineNo">3079</span> }<a name="line.3079"></a>
- <span class="sourceLineNo">3080</span> }<a name="line.3080"></a>
- <span class="sourceLineNo">3081</span> return space;<a name="line.3081"></a>
- <span class="sourceLineNo">3082</span><a name="line.3082"></a>
- <span class="sourceLineNo">3083</span> }<a name="line.3083"></a>
- <span class="sourceLineNo">3084</span><a name="line.3084"></a>
- <span class="sourceLineNo">3085</span> /**<a name="line.3085"></a>
- <span class="sourceLineNo">3086</span> * Trims a rectangle to integer coordinates.<a name="line.3086"></a>
- <span class="sourceLineNo">3087</span> *<a name="line.3087"></a>
- <span class="sourceLineNo">3088</span> * @param rect the incoming rectangle.<a name="line.3088"></a>
- <span class="sourceLineNo">3089</span> *<a name="line.3089"></a>
- <span class="sourceLineNo">3090</span> * @return A rectangle with integer coordinates.<a name="line.3090"></a>
- <span class="sourceLineNo">3091</span> */<a name="line.3091"></a>
- <span class="sourceLineNo">3092</span> private Rectangle integerise(Rectangle2D rect) {<a name="line.3092"></a>
- <span class="sourceLineNo">3093</span> int x0 = (int) Math.ceil(rect.getMinX());<a name="line.3093"></a>
- <span class="sourceLineNo">3094</span> int y0 = (int) Math.ceil(rect.getMinY());<a name="line.3094"></a>
- <span class="sourceLineNo">3095</span> int x1 = (int) Math.floor(rect.getMaxX());<a name="line.3095"></a>
- <span class="sourceLineNo">3096</span> int y1 = (int) Math.floor(rect.getMaxY());<a name="line.3096"></a>
- <span class="sourceLineNo">3097</span> return new Rectangle(x0, y0, (x1 - x0), (y1 - y0));<a name="line.3097"></a>
- <span class="sourceLineNo">3098</span> }<a name="line.3098"></a>
- <span class="sourceLineNo">3099</span><a name="line.3099"></a>
- <span class="sourceLineNo">3100</span> /**<a name="line.3100"></a>
- <span class="sourceLineNo">3101</span> * Draws the plot within the specified area on a graphics device.<a name="line.3101"></a>
- <span class="sourceLineNo">3102</span> *<a name="line.3102"></a>
- <span class="sourceLineNo">3103</span> * @param g2 the graphics device.<a name="line.3103"></a>
- <span class="sourceLineNo">3104</span> * @param area the plot area (in Java2D space).<a name="line.3104"></a>
- <span class="sourceLineNo">3105</span> * @param anchor an anchor point in Java2D space (<code>null</code><a name="line.3105"></a>
- <span class="sourceLineNo">3106</span> * permitted).<a name="line.3106"></a>
- <span class="sourceLineNo">3107</span> * @param parentState the state from the parent plot, if there is one<a name="line.3107"></a>
- <span class="sourceLineNo">3108</span> * (<code>null</code> permitted).<a name="line.3108"></a>
- <span class="sourceLineNo">3109</span> * @param info collects chart drawing information (<code>null</code><a name="line.3109"></a>
- <span class="sourceLineNo">3110</span> * permitted).<a name="line.3110"></a>
- <span class="sourceLineNo">3111</span> */<a name="line.3111"></a>
- <span class="sourceLineNo">3112</span> @Override<a name="line.3112"></a>
- <span class="sourceLineNo">3113</span> public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,<a name="line.3113"></a>
- <span class="sourceLineNo">3114</span> PlotState parentState, PlotRenderingInfo info) {<a name="line.3114"></a>
- <span class="sourceLineNo">3115</span><a name="line.3115"></a>
- <span class="sourceLineNo">3116</span> // if the plot area is too small, just return...<a name="line.3116"></a>
- <span class="sourceLineNo">3117</span> boolean b1 = (area.getWidth() <= MINIMUM_WIDTH_TO_DRAW);<a name="line.3117"></a>
- <span class="sourceLineNo">3118</span> boolean b2 = (area.getHeight() <= MINIMUM_HEIGHT_TO_DRAW);<a name="line.3118"></a>
- <span class="sourceLineNo">3119</span> if (b1 || b2) {<a name="line.3119"></a>
- <span class="sourceLineNo">3120</span> return;<a name="line.3120"></a>
- <span class="sourceLineNo">3121</span> }<a name="line.3121"></a>
- <span class="sourceLineNo">3122</span><a name="line.3122"></a>
- <span class="sourceLineNo">3123</span> // record the plot area...<a name="line.3123"></a>
- <span class="sourceLineNo">3124</span> if (info != null) {<a name="line.3124"></a>
- <span class="sourceLineNo">3125</span> info.setPlotArea(area);<a name="line.3125"></a>
- <span class="sourceLineNo">3126</span> }<a name="line.3126"></a>
- <span class="sourceLineNo">3127</span><a name="line.3127"></a>
- <span class="sourceLineNo">3128</span> // adjust the drawing area for the plot insets (if any)...<a name="line.3128"></a>
- <span class="sourceLineNo">3129</span> RectangleInsets insets = getInsets();<a name="line.3129"></a>
- <span class="sourceLineNo">3130</span> insets.trim(area);<a name="line.3130"></a>
- <span class="sourceLineNo">3131</span><a name="line.3131"></a>
- <span class="sourceLineNo">3132</span> AxisSpace space = calculateAxisSpace(g2, area);<a name="line.3132"></a>
- <span class="sourceLineNo">3133</span> Rectangle2D dataArea = space.shrink(area, null);<a name="line.3133"></a>
- <span class="sourceLineNo">3134</span> this.axisOffset.trim(dataArea);<a name="line.3134"></a>
- <span class="sourceLineNo">3135</span><a name="line.3135"></a>
- <span class="sourceLineNo">3136</span> dataArea = integerise(dataArea);<a name="line.3136"></a>
- <span class="sourceLineNo">3137</span> if (dataArea.isEmpty()) {<a name="line.3137"></a>
- <span class="sourceLineNo">3138</span> return;<a name="line.3138"></a>
- <span class="sourceLineNo">3139</span> }<a name="line.3139"></a>
- <span class="sourceLineNo">3140</span> createAndAddEntity((Rectangle2D) dataArea.clone(), info, null, null);<a name="line.3140"></a>
- <span class="sourceLineNo">3141</span> if (info != null) {<a name="line.3141"></a>
- <span class="sourceLineNo">3142</span> info.setDataArea(dataArea);<a name="line.3142"></a>
- <span class="sourceLineNo">3143</span> }<a name="line.3143"></a>
- <span class="sourceLineNo">3144</span><a name="line.3144"></a>
- <span class="sourceLineNo">3145</span> // draw the plot background and axes...<a name="line.3145"></a>
- <span class="sourceLineNo">3146</span> drawBackground(g2, dataArea);<a name="line.3146"></a>
- <span class="sourceLineNo">3147</span> Map axisStateMap = drawAxes(g2, area, dataArea, info);<a name="line.3147"></a>
- <span class="sourceLineNo">3148</span><a name="line.3148"></a>
- <span class="sourceLineNo">3149</span> PlotOrientation orient = getOrientation();<a name="line.3149"></a>
- <span class="sourceLineNo">3150</span><a name="line.3150"></a>
- <span class="sourceLineNo">3151</span> // the anchor point is typically the point where the mouse last<a name="line.3151"></a>
- <span class="sourceLineNo">3152</span> // clicked - the crosshairs will be driven off this point...<a name="line.3152"></a>
- <span class="sourceLineNo">3153</span> if (anchor != null && !dataArea.contains(anchor)) {<a name="line.3153"></a>
- <span class="sourceLineNo">3154</span> anchor = null;<a name="line.3154"></a>
- <span class="sourceLineNo">3155</span> }<a name="line.3155"></a>
- <span class="sourceLineNo">3156</span> CrosshairState crosshairState = new CrosshairState();<a name="line.3156"></a>
- <span class="sourceLineNo">3157</span> crosshairState.setCrosshairDistance(Double.POSITIVE_INFINITY);<a name="line.3157"></a>
- <span class="sourceLineNo">3158</span> crosshairState.setAnchor(anchor);<a name="line.3158"></a>
- <span class="sourceLineNo">3159</span><a name="line.3159"></a>
- <span class="sourceLineNo">3160</span> crosshairState.setAnchorX(Double.NaN);<a name="line.3160"></a>
- <span class="sourceLineNo">3161</span> crosshairState.setAnchorY(Double.NaN);<a name="line.3161"></a>
- <span class="sourceLineNo">3162</span> if (anchor != null) {<a name="line.3162"></a>
- <span class="sourceLineNo">3163</span> ValueAxis domainAxis = getDomainAxis();<a name="line.3163"></a>
- <span class="sourceLineNo">3164</span> if (domainAxis != null) {<a name="line.3164"></a>
- <span class="sourceLineNo">3165</span> double x;<a name="line.3165"></a>
- <span class="sourceLineNo">3166</span> if (orient == PlotOrientation.VERTICAL) {<a name="line.3166"></a>
- <span class="sourceLineNo">3167</span> x = domainAxis.java2DToValue(anchor.getX(), dataArea,<a name="line.3167"></a>
- <span class="sourceLineNo">3168</span> getDomainAxisEdge());<a name="line.3168"></a>
- <span class="sourceLineNo">3169</span> }<a name="line.3169"></a>
- <span class="sourceLineNo">3170</span> else {<a name="line.3170"></a>
- <span class="sourceLineNo">3171</span> x = domainAxis.java2DToValue(anchor.getY(), dataArea,<a name="line.3171"></a>
- <span class="sourceLineNo">3172</span> getDomainAxisEdge());<a name="line.3172"></a>
- <span class="sourceLineNo">3173</span> }<a name="line.3173"></a>
- <span class="sourceLineNo">3174</span> crosshairState.setAnchorX(x);<a name="line.3174"></a>
- <span class="sourceLineNo">3175</span> }<a name="line.3175"></a>
- <span class="sourceLineNo">3176</span> ValueAxis rangeAxis = getRangeAxis();<a name="line.3176"></a>
- <span class="sourceLineNo">3177</span> if (rangeAxis != null) {<a name="line.3177"></a>
- <span class="sourceLineNo">3178</span> double y;<a name="line.3178"></a>
- <span class="sourceLineNo">3179</span> if (orient == PlotOrientation.VERTICAL) {<a name="line.3179"></a>
- <span class="sourceLineNo">3180</span> y = rangeAxis.java2DToValue(anchor.getY(), dataArea,<a name="line.3180"></a>
- <span class="sourceLineNo">3181</span> getRangeAxisEdge());<a name="line.3181"></a>
- <span class="sourceLineNo">3182</span> }<a name="line.3182"></a>
- <span class="sourceLineNo">3183</span> else {<a name="line.3183"></a>
- <span class="sourceLineNo">3184</span> y = rangeAxis.java2DToValue(anchor.getX(), dataArea,<a name="line.3184"></a>
- <span class="sourceLineNo">3185</span> getRangeAxisEdge());<a name="line.3185"></a>
- <span class="sourceLineNo">3186</span> }<a name="line.3186"></a>
- <span class="sourceLineNo">3187</span> crosshairState.setAnchorY(y);<a name="line.3187"></a>
- <span class="sourceLineNo">3188</span> }<a name="line.3188"></a>
- <span class="sourceLineNo">3189</span> }<a name="line.3189"></a>
- <span class="sourceLineNo">3190</span> crosshairState.setCrosshairX(getDomainCrosshairValue());<a name="line.3190"></a>
- <span class="sourceLineNo">3191</span> crosshairState.setCrosshairY(getRangeCrosshairValue());<a name="line.3191"></a>
- <span class="sourceLineNo">3192</span> Shape originalClip = g2.getClip();<a name="line.3192"></a>
- <span class="sourceLineNo">3193</span> Composite originalComposite = g2.getComposite();<a name="line.3193"></a>
- <span class="sourceLineNo">3194</span><a name="line.3194"></a>
- <span class="sourceLineNo">3195</span> g2.clip(dataArea);<a name="line.3195"></a>
- <span class="sourceLineNo">3196</span> g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,<a name="line.3196"></a>
- <span class="sourceLineNo">3197</span> getForegroundAlpha()));<a name="line.3197"></a>
- <span class="sourceLineNo">3198</span><a name="line.3198"></a>
- <span class="sourceLineNo">3199</span> AxisState domainAxisState = (AxisState) axisStateMap.get(<a name="line.3199"></a>
- <span class="sourceLineNo">3200</span> getDomainAxis());<a name="line.3200"></a>
- <span class="sourceLineNo">3201</span> if (domainAxisState == null) {<a name="line.3201"></a>
- <span class="sourceLineNo">3202</span> if (parentState != null) {<a name="line.3202"></a>
- <span class="sourceLineNo">3203</span> domainAxisState = (AxisState) parentState.getSharedAxisStates()<a name="line.3203"></a>
- <span class="sourceLineNo">3204</span> .get(getDomainAxis());<a name="line.3204"></a>
- <span class="sourceLineNo">3205</span> }<a name="line.3205"></a>
- <span class="sourceLineNo">3206</span> }<a name="line.3206"></a>
- <span class="sourceLineNo">3207</span><a name="line.3207"></a>
- <span class="sourceLineNo">3208</span> AxisState rangeAxisState = (AxisState) axisStateMap.get(getRangeAxis());<a name="line.3208"></a>
- <span class="sourceLineNo">3209</span> if (rangeAxisState == null) {<a name="line.3209"></a>
- <span class="sourceLineNo">3210</span> if (parentState != null) {<a name="line.3210"></a>
- <span class="sourceLineNo">3211</span> rangeAxisState = (AxisState) parentState.getSharedAxisStates()<a name="line.3211"></a>
- <span class="sourceLineNo">3212</span> .get(getRangeAxis());<a name="line.3212"></a>
- <span class="sourceLineNo">3213</span> }<a name="line.3213"></a>
- <span class="sourceLineNo">3214</span> }<a name="line.3214"></a>
- <span class="sourceLineNo">3215</span> if (domainAxisState != null) {<a name="line.3215"></a>
- <span class="sourceLineNo">3216</span> drawDomainTickBands(g2, dataArea, domainAxisState.getTicks());<a name="line.3216"></a>
- <span class="sourceLineNo">3217</span> }<a name="line.3217"></a>
- <span class="sourceLineNo">3218</span> if (rangeAxisState != null) {<a name="line.3218"></a>
- <span class="sourceLineNo">3219</span> drawRangeTickBands(g2, dataArea, rangeAxisState.getTicks());<a name="line.3219"></a>
- <span class="sourceLineNo">3220</span> }<a name="line.3220"></a>
- <span class="sourceLineNo">3221</span> if (domainAxisState != null) {<a name="line.3221"></a>
- <span class="sourceLineNo">3222</span> drawDomainGridlines(g2, dataArea, domainAxisState.getTicks());<a name="line.3222"></a>
- <span class="sourceLineNo">3223</span> drawZeroDomainBaseline(g2, dataArea);<a name="line.3223"></a>
- <span class="sourceLineNo">3224</span> }<a name="line.3224"></a>
- <span class="sourceLineNo">3225</span> if (rangeAxisState != null) {<a name="line.3225"></a>
- <span class="sourceLineNo">3226</span> drawRangeGridlines(g2, dataArea, rangeAxisState.getTicks());<a name="line.3226"></a>
- <span class="sourceLineNo">3227</span> drawZeroRangeBaseline(g2, dataArea);<a name="line.3227"></a>
- <span class="sourceLineNo">3228</span> }<a name="line.3228"></a>
- <span class="sourceLineNo">3229</span><a name="line.3229"></a>
- <span class="sourceLineNo">3230</span> Graphics2D savedG2 = g2;<a name="line.3230"></a>
- <span class="sourceLineNo">3231</span> BufferedImage dataImage = null;<a name="line.3231"></a>
- <span class="sourceLineNo">3232</span> boolean suppressShadow = Boolean.TRUE.equals(g2.getRenderingHint(<a name="line.3232"></a>
- <span class="sourceLineNo">3233</span> JFreeChart.KEY_SUPPRESS_SHADOW_GENERATION));<a name="line.3233"></a>
- <span class="sourceLineNo">3234</span> if (this.shadowGenerator != null && !suppressShadow) {<a name="line.3234"></a>
- <span class="sourceLineNo">3235</span> dataImage = new BufferedImage((int) dataArea.getWidth(),<a name="line.3235"></a>
- <span class="sourceLineNo">3236</span> (int)dataArea.getHeight(), BufferedImage.TYPE_INT_ARGB);<a name="line.3236"></a>
- <span class="sourceLineNo">3237</span> g2 = dataImage.createGraphics();<a name="line.3237"></a>
- <span class="sourceLineNo">3238</span> g2.translate(-dataArea.getX(), -dataArea.getY());<a name="line.3238"></a>
- <span class="sourceLineNo">3239</span> g2.setRenderingHints(savedG2.getRenderingHints());<a name="line.3239"></a>
- <span class="sourceLineNo">3240</span> }<a name="line.3240"></a>
- <span class="sourceLineNo">3241</span><a name="line.3241"></a>
- <span class="sourceLineNo">3242</span> // draw the markers that are associated with a specific dataset...<a name="line.3242"></a>
- <span class="sourceLineNo">3243</span> for (XYDataset dataset: this.datasets.values()) {<a name="line.3243"></a>
- <span class="sourceLineNo">3244</span> int datasetIndex = indexOf(dataset);<a name="line.3244"></a>
- <span class="sourceLineNo">3245</span> drawDomainMarkers(g2, dataArea, datasetIndex, Layer.BACKGROUND);<a name="line.3245"></a>
- <span class="sourceLineNo">3246</span> }<a name="line.3246"></a>
- <span class="sourceLineNo">3247</span> for (XYDataset dataset: this.datasets.values()) {<a name="line.3247"></a>
- <span class="sourceLineNo">3248</span> int datasetIndex = indexOf(dataset);<a name="line.3248"></a>
- <span class="sourceLineNo">3249</span> drawRangeMarkers(g2, dataArea, datasetIndex, Layer.BACKGROUND);<a name="line.3249"></a>
- <span class="sourceLineNo">3250</span> }<a name="line.3250"></a>
- <span class="sourceLineNo">3251</span><a name="line.3251"></a>
- <span class="sourceLineNo">3252</span> // now draw annotations and render data items...<a name="line.3252"></a>
- <span class="sourceLineNo">3253</span> boolean foundData = false;<a name="line.3253"></a>
- <span class="sourceLineNo">3254</span> DatasetRenderingOrder order = getDatasetRenderingOrder();<a name="line.3254"></a>
- <span class="sourceLineNo">3255</span> List<Integer> rendererIndices = getRendererIndices(order);<a name="line.3255"></a>
- <span class="sourceLineNo">3256</span> List<Integer> datasetIndices = getDatasetIndices(order);<a name="line.3256"></a>
- <span class="sourceLineNo">3257</span> // draw background annotations<a name="line.3257"></a>
- <span class="sourceLineNo">3258</span> for (int i : rendererIndices) {<a name="line.3258"></a>
- <span class="sourceLineNo">3259</span> XYItemRenderer renderer = getRenderer(i);<a name="line.3259"></a>
- <span class="sourceLineNo">3260</span> if (renderer != null) {<a name="line.3260"></a>
- <span class="sourceLineNo">3261</span> ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3261"></a>
- <span class="sourceLineNo">3262</span> ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3262"></a>
- <span class="sourceLineNo">3263</span> renderer.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, <a name="line.3263"></a>
- <span class="sourceLineNo">3264</span> Layer.BACKGROUND, info);<a name="line.3264"></a>
- <span class="sourceLineNo">3265</span> }<a name="line.3265"></a>
- <span class="sourceLineNo">3266</span> }<a name="line.3266"></a>
- <span class="sourceLineNo">3267</span><a name="line.3267"></a>
- <span class="sourceLineNo">3268</span> // render data items...<a name="line.3268"></a>
- <span class="sourceLineNo">3269</span> for (int datasetIndex : datasetIndices) {<a name="line.3269"></a>
- <span class="sourceLineNo">3270</span> XYDataset dataset = this.getDataset(datasetIndex);<a name="line.3270"></a>
- <span class="sourceLineNo">3271</span> foundData = render(g2, dataArea, datasetIndex, info, <a name="line.3271"></a>
- <span class="sourceLineNo">3272</span> crosshairState) || foundData;<a name="line.3272"></a>
- <span class="sourceLineNo">3273</span> }<a name="line.3273"></a>
- <span class="sourceLineNo">3274</span><a name="line.3274"></a>
- <span class="sourceLineNo">3275</span> // draw foreground annotations<a name="line.3275"></a>
- <span class="sourceLineNo">3276</span> for (int i : rendererIndices) {<a name="line.3276"></a>
- <span class="sourceLineNo">3277</span> XYItemRenderer renderer = getRenderer(i);<a name="line.3277"></a>
- <span class="sourceLineNo">3278</span> if (renderer != null) {<a name="line.3278"></a>
- <span class="sourceLineNo">3279</span> ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3279"></a>
- <span class="sourceLineNo">3280</span> ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3280"></a>
- <span class="sourceLineNo">3281</span> renderer.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, <a name="line.3281"></a>
- <span class="sourceLineNo">3282</span> Layer.FOREGROUND, info);<a name="line.3282"></a>
- <span class="sourceLineNo">3283</span> }<a name="line.3283"></a>
- <span class="sourceLineNo">3284</span> }<a name="line.3284"></a>
- <span class="sourceLineNo">3285</span><a name="line.3285"></a>
- <span class="sourceLineNo">3286</span> // draw domain crosshair if required...<a name="line.3286"></a>
- <span class="sourceLineNo">3287</span> int datasetIndex = crosshairState.getDatasetIndex();<a name="line.3287"></a>
- <span class="sourceLineNo">3288</span> ValueAxis xAxis = this.getDomainAxisForDataset(datasetIndex);<a name="line.3288"></a>
- <span class="sourceLineNo">3289</span> RectangleEdge xAxisEdge = getDomainAxisEdge(getDomainAxisIndex(xAxis));<a name="line.3289"></a>
- <span class="sourceLineNo">3290</span> if (!this.domainCrosshairLockedOnData && anchor != null) {<a name="line.3290"></a>
- <span class="sourceLineNo">3291</span> double xx;<a name="line.3291"></a>
- <span class="sourceLineNo">3292</span> if (orient == PlotOrientation.VERTICAL) {<a name="line.3292"></a>
- <span class="sourceLineNo">3293</span> xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);<a name="line.3293"></a>
- <span class="sourceLineNo">3294</span> }<a name="line.3294"></a>
- <span class="sourceLineNo">3295</span> else {<a name="line.3295"></a>
- <span class="sourceLineNo">3296</span> xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);<a name="line.3296"></a>
- <span class="sourceLineNo">3297</span> }<a name="line.3297"></a>
- <span class="sourceLineNo">3298</span> crosshairState.setCrosshairX(xx);<a name="line.3298"></a>
- <span class="sourceLineNo">3299</span> }<a name="line.3299"></a>
- <span class="sourceLineNo">3300</span> setDomainCrosshairValue(crosshairState.getCrosshairX(), false);<a name="line.3300"></a>
- <span class="sourceLineNo">3301</span> if (isDomainCrosshairVisible()) {<a name="line.3301"></a>
- <span class="sourceLineNo">3302</span> double x = getDomainCrosshairValue();<a name="line.3302"></a>
- <span class="sourceLineNo">3303</span> Paint paint = getDomainCrosshairPaint();<a name="line.3303"></a>
- <span class="sourceLineNo">3304</span> Stroke stroke = getDomainCrosshairStroke();<a name="line.3304"></a>
- <span class="sourceLineNo">3305</span> drawDomainCrosshair(g2, dataArea, orient, x, xAxis, stroke, paint);<a name="line.3305"></a>
- <span class="sourceLineNo">3306</span> }<a name="line.3306"></a>
- <span class="sourceLineNo">3307</span><a name="line.3307"></a>
- <span class="sourceLineNo">3308</span> // draw range crosshair if required...<a name="line.3308"></a>
- <span class="sourceLineNo">3309</span> ValueAxis yAxis = getRangeAxisForDataset(datasetIndex);<a name="line.3309"></a>
- <span class="sourceLineNo">3310</span> RectangleEdge yAxisEdge = getRangeAxisEdge(getRangeAxisIndex(yAxis));<a name="line.3310"></a>
- <span class="sourceLineNo">3311</span> if (!this.rangeCrosshairLockedOnData && anchor != null) {<a name="line.3311"></a>
- <span class="sourceLineNo">3312</span> double yy;<a name="line.3312"></a>
- <span class="sourceLineNo">3313</span> if (orient == PlotOrientation.VERTICAL) {<a name="line.3313"></a>
- <span class="sourceLineNo">3314</span> yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);<a name="line.3314"></a>
- <span class="sourceLineNo">3315</span> } else {<a name="line.3315"></a>
- <span class="sourceLineNo">3316</span> yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);<a name="line.3316"></a>
- <span class="sourceLineNo">3317</span> }<a name="line.3317"></a>
- <span class="sourceLineNo">3318</span> crosshairState.setCrosshairY(yy);<a name="line.3318"></a>
- <span class="sourceLineNo">3319</span> }<a name="line.3319"></a>
- <span class="sourceLineNo">3320</span> setRangeCrosshairValue(crosshairState.getCrosshairY(), false);<a name="line.3320"></a>
- <span class="sourceLineNo">3321</span> if (isRangeCrosshairVisible()) {<a name="line.3321"></a>
- <span class="sourceLineNo">3322</span> double y = getRangeCrosshairValue();<a name="line.3322"></a>
- <span class="sourceLineNo">3323</span> Paint paint = getRangeCrosshairPaint();<a name="line.3323"></a>
- <span class="sourceLineNo">3324</span> Stroke stroke = getRangeCrosshairStroke();<a name="line.3324"></a>
- <span class="sourceLineNo">3325</span> drawRangeCrosshair(g2, dataArea, orient, y, yAxis, stroke, paint);<a name="line.3325"></a>
- <span class="sourceLineNo">3326</span> }<a name="line.3326"></a>
- <span class="sourceLineNo">3327</span><a name="line.3327"></a>
- <span class="sourceLineNo">3328</span> if (!foundData) {<a name="line.3328"></a>
- <span class="sourceLineNo">3329</span> drawNoDataMessage(g2, dataArea);<a name="line.3329"></a>
- <span class="sourceLineNo">3330</span> }<a name="line.3330"></a>
- <span class="sourceLineNo">3331</span><a name="line.3331"></a>
- <span class="sourceLineNo">3332</span> for (int i : rendererIndices) { <a name="line.3332"></a>
- <span class="sourceLineNo">3333</span> drawDomainMarkers(g2, dataArea, i, Layer.FOREGROUND);<a name="line.3333"></a>
- <span class="sourceLineNo">3334</span> }<a name="line.3334"></a>
- <span class="sourceLineNo">3335</span> for (int i : rendererIndices) {<a name="line.3335"></a>
- <span class="sourceLineNo">3336</span> drawRangeMarkers(g2, dataArea, i, Layer.FOREGROUND);<a name="line.3336"></a>
- <span class="sourceLineNo">3337</span> }<a name="line.3337"></a>
- <span class="sourceLineNo">3338</span><a name="line.3338"></a>
- <span class="sourceLineNo">3339</span> drawAnnotations(g2, dataArea, info);<a name="line.3339"></a>
- <span class="sourceLineNo">3340</span> if (this.shadowGenerator != null && !suppressShadow) {<a name="line.3340"></a>
- <span class="sourceLineNo">3341</span> BufferedImage shadowImage<a name="line.3341"></a>
- <span class="sourceLineNo">3342</span> = this.shadowGenerator.createDropShadow(dataImage);<a name="line.3342"></a>
- <span class="sourceLineNo">3343</span> g2 = savedG2;<a name="line.3343"></a>
- <span class="sourceLineNo">3344</span> g2.drawImage(shadowImage, (int) dataArea.getX()<a name="line.3344"></a>
- <span class="sourceLineNo">3345</span> + this.shadowGenerator.calculateOffsetX(),<a name="line.3345"></a>
- <span class="sourceLineNo">3346</span> (int) dataArea.getY()<a name="line.3346"></a>
- <span class="sourceLineNo">3347</span> + this.shadowGenerator.calculateOffsetY(), null);<a name="line.3347"></a>
- <span class="sourceLineNo">3348</span> g2.drawImage(dataImage, (int) dataArea.getX(),<a name="line.3348"></a>
- <span class="sourceLineNo">3349</span> (int) dataArea.getY(), null);<a name="line.3349"></a>
- <span class="sourceLineNo">3350</span> }<a name="line.3350"></a>
- <span class="sourceLineNo">3351</span> g2.setClip(originalClip);<a name="line.3351"></a>
- <span class="sourceLineNo">3352</span> g2.setComposite(originalComposite);<a name="line.3352"></a>
- <span class="sourceLineNo">3353</span><a name="line.3353"></a>
- <span class="sourceLineNo">3354</span> drawOutline(g2, dataArea);<a name="line.3354"></a>
- <span class="sourceLineNo">3355</span><a name="line.3355"></a>
- <span class="sourceLineNo">3356</span> }<a name="line.3356"></a>
- <span class="sourceLineNo">3357</span><a name="line.3357"></a>
- <span class="sourceLineNo">3358</span> /**<a name="line.3358"></a>
- <span class="sourceLineNo">3359</span> * Returns the indices of the non-null datasets in the specified order.<a name="line.3359"></a>
- <span class="sourceLineNo">3360</span> * <a name="line.3360"></a>
- <span class="sourceLineNo">3361</span> * @param order the order (<code>null</code> not permitted).<a name="line.3361"></a>
- <span class="sourceLineNo">3362</span> * <a name="line.3362"></a>
- <span class="sourceLineNo">3363</span> * @return The list of indices. <a name="line.3363"></a>
- <span class="sourceLineNo">3364</span> */<a name="line.3364"></a>
- <span class="sourceLineNo">3365</span> private List<Integer> getDatasetIndices(DatasetRenderingOrder order) {<a name="line.3365"></a>
- <span class="sourceLineNo">3366</span> List<Integer> result = new ArrayList<Integer>();<a name="line.3366"></a>
- <span class="sourceLineNo">3367</span> for (Entry<Integer, XYDataset> entry : this.datasets.entrySet()) {<a name="line.3367"></a>
- <span class="sourceLineNo">3368</span> if (entry.getValue() != null) {<a name="line.3368"></a>
- <span class="sourceLineNo">3369</span> result.add(entry.getKey());<a name="line.3369"></a>
- <span class="sourceLineNo">3370</span> }<a name="line.3370"></a>
- <span class="sourceLineNo">3371</span> }<a name="line.3371"></a>
- <span class="sourceLineNo">3372</span> Collections.sort(result);<a name="line.3372"></a>
- <span class="sourceLineNo">3373</span> if (order == DatasetRenderingOrder.REVERSE) {<a name="line.3373"></a>
- <span class="sourceLineNo">3374</span> Collections.reverse(result);<a name="line.3374"></a>
- <span class="sourceLineNo">3375</span> }<a name="line.3375"></a>
- <span class="sourceLineNo">3376</span> return result;<a name="line.3376"></a>
- <span class="sourceLineNo">3377</span> }<a name="line.3377"></a>
- <span class="sourceLineNo">3378</span> <a name="line.3378"></a>
- <span class="sourceLineNo">3379</span> private List<Integer> getRendererIndices(DatasetRenderingOrder order) {<a name="line.3379"></a>
- <span class="sourceLineNo">3380</span> List<Integer> result = new ArrayList<Integer>();<a name="line.3380"></a>
- <span class="sourceLineNo">3381</span> for (Entry<Integer, XYItemRenderer> entry : this.renderers.entrySet()) {<a name="line.3381"></a>
- <span class="sourceLineNo">3382</span> if (entry.getValue() != null) {<a name="line.3382"></a>
- <span class="sourceLineNo">3383</span> result.add(entry.getKey());<a name="line.3383"></a>
- <span class="sourceLineNo">3384</span> }<a name="line.3384"></a>
- <span class="sourceLineNo">3385</span> }<a name="line.3385"></a>
- <span class="sourceLineNo">3386</span> Collections.sort(result);<a name="line.3386"></a>
- <span class="sourceLineNo">3387</span> if (order == DatasetRenderingOrder.REVERSE) {<a name="line.3387"></a>
- <span class="sourceLineNo">3388</span> Collections.reverse(result);<a name="line.3388"></a>
- <span class="sourceLineNo">3389</span> }<a name="line.3389"></a>
- <span class="sourceLineNo">3390</span> return result; <a name="line.3390"></a>
- <span class="sourceLineNo">3391</span> }<a name="line.3391"></a>
- <span class="sourceLineNo">3392</span> <a name="line.3392"></a>
- <span class="sourceLineNo">3393</span> /**<a name="line.3393"></a>
- <span class="sourceLineNo">3394</span> * Draws the background for the plot.<a name="line.3394"></a>
- <span class="sourceLineNo">3395</span> *<a name="line.3395"></a>
- <span class="sourceLineNo">3396</span> * @param g2 the graphics device.<a name="line.3396"></a>
- <span class="sourceLineNo">3397</span> * @param area the area.<a name="line.3397"></a>
- <span class="sourceLineNo">3398</span> */<a name="line.3398"></a>
- <span class="sourceLineNo">3399</span> @Override<a name="line.3399"></a>
- <span class="sourceLineNo">3400</span> public void drawBackground(Graphics2D g2, Rectangle2D area) {<a name="line.3400"></a>
- <span class="sourceLineNo">3401</span> fillBackground(g2, area, this.orientation);<a name="line.3401"></a>
- <span class="sourceLineNo">3402</span> drawQuadrants(g2, area);<a name="line.3402"></a>
- <span class="sourceLineNo">3403</span> drawBackgroundImage(g2, area);<a name="line.3403"></a>
- <span class="sourceLineNo">3404</span> }<a name="line.3404"></a>
- <span class="sourceLineNo">3405</span><a name="line.3405"></a>
- <span class="sourceLineNo">3406</span> /**<a name="line.3406"></a>
- <span class="sourceLineNo">3407</span> * Draws the quadrants.<a name="line.3407"></a>
- <span class="sourceLineNo">3408</span> *<a name="line.3408"></a>
- <span class="sourceLineNo">3409</span> * @param g2 the graphics device.<a name="line.3409"></a>
- <span class="sourceLineNo">3410</span> * @param area the area.<a name="line.3410"></a>
- <span class="sourceLineNo">3411</span> *<a name="line.3411"></a>
- <span class="sourceLineNo">3412</span> * @see #setQuadrantOrigin(Point2D)<a name="line.3412"></a>
- <span class="sourceLineNo">3413</span> * @see #setQuadrantPaint(int, Paint)<a name="line.3413"></a>
- <span class="sourceLineNo">3414</span> */<a name="line.3414"></a>
- <span class="sourceLineNo">3415</span> protected void drawQuadrants(Graphics2D g2, Rectangle2D area) {<a name="line.3415"></a>
- <span class="sourceLineNo">3416</span> // 0 | 1<a name="line.3416"></a>
- <span class="sourceLineNo">3417</span> // --+--<a name="line.3417"></a>
- <span class="sourceLineNo">3418</span> // 2 | 3<a name="line.3418"></a>
- <span class="sourceLineNo">3419</span> boolean somethingToDraw = false;<a name="line.3419"></a>
- <span class="sourceLineNo">3420</span><a name="line.3420"></a>
- <span class="sourceLineNo">3421</span> ValueAxis xAxis = getDomainAxis();<a name="line.3421"></a>
- <span class="sourceLineNo">3422</span> if (xAxis == null) { // we can't draw quadrants without a valid x-axis<a name="line.3422"></a>
- <span class="sourceLineNo">3423</span> return;<a name="line.3423"></a>
- <span class="sourceLineNo">3424</span> }<a name="line.3424"></a>
- <span class="sourceLineNo">3425</span> double x = xAxis.getRange().constrain(this.quadrantOrigin.getX());<a name="line.3425"></a>
- <span class="sourceLineNo">3426</span> double xx = xAxis.valueToJava2D(x, area, getDomainAxisEdge());<a name="line.3426"></a>
- <span class="sourceLineNo">3427</span><a name="line.3427"></a>
- <span class="sourceLineNo">3428</span> ValueAxis yAxis = getRangeAxis();<a name="line.3428"></a>
- <span class="sourceLineNo">3429</span> if (yAxis == null) { // we can't draw quadrants without a valid y-axis<a name="line.3429"></a>
- <span class="sourceLineNo">3430</span> return;<a name="line.3430"></a>
- <span class="sourceLineNo">3431</span> }<a name="line.3431"></a>
- <span class="sourceLineNo">3432</span> double y = yAxis.getRange().constrain(this.quadrantOrigin.getY());<a name="line.3432"></a>
- <span class="sourceLineNo">3433</span> double yy = yAxis.valueToJava2D(y, area, getRangeAxisEdge());<a name="line.3433"></a>
- <span class="sourceLineNo">3434</span><a name="line.3434"></a>
- <span class="sourceLineNo">3435</span> double xmin = xAxis.getLowerBound();<a name="line.3435"></a>
- <span class="sourceLineNo">3436</span> double xxmin = xAxis.valueToJava2D(xmin, area, getDomainAxisEdge());<a name="line.3436"></a>
- <span class="sourceLineNo">3437</span><a name="line.3437"></a>
- <span class="sourceLineNo">3438</span> double xmax = xAxis.getUpperBound();<a name="line.3438"></a>
- <span class="sourceLineNo">3439</span> double xxmax = xAxis.valueToJava2D(xmax, area, getDomainAxisEdge());<a name="line.3439"></a>
- <span class="sourceLineNo">3440</span><a name="line.3440"></a>
- <span class="sourceLineNo">3441</span> double ymin = yAxis.getLowerBound();<a name="line.3441"></a>
- <span class="sourceLineNo">3442</span> double yymin = yAxis.valueToJava2D(ymin, area, getRangeAxisEdge());<a name="line.3442"></a>
- <span class="sourceLineNo">3443</span><a name="line.3443"></a>
- <span class="sourceLineNo">3444</span> double ymax = yAxis.getUpperBound();<a name="line.3444"></a>
- <span class="sourceLineNo">3445</span> double yymax = yAxis.valueToJava2D(ymax, area, getRangeAxisEdge());<a name="line.3445"></a>
- <span class="sourceLineNo">3446</span><a name="line.3446"></a>
- <span class="sourceLineNo">3447</span> Rectangle2D[] r = new Rectangle2D[] {null, null, null, null};<a name="line.3447"></a>
- <span class="sourceLineNo">3448</span> if (this.quadrantPaint[0] != null) {<a name="line.3448"></a>
- <span class="sourceLineNo">3449</span> if (x > xmin && y < ymax) {<a name="line.3449"></a>
- <span class="sourceLineNo">3450</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3450"></a>
- <span class="sourceLineNo">3451</span> r[0] = new Rectangle2D.Double(Math.min(yymax, yy),<a name="line.3451"></a>
- <span class="sourceLineNo">3452</span> Math.min(xxmin, xx), Math.abs(yy - yymax),<a name="line.3452"></a>
- <span class="sourceLineNo">3453</span> Math.abs(xx - xxmin));<a name="line.3453"></a>
- <span class="sourceLineNo">3454</span> }<a name="line.3454"></a>
- <span class="sourceLineNo">3455</span> else { // PlotOrientation.VERTICAL<a name="line.3455"></a>
- <span class="sourceLineNo">3456</span> r[0] = new Rectangle2D.Double(Math.min(xxmin, xx),<a name="line.3456"></a>
- <span class="sourceLineNo">3457</span> Math.min(yymax, yy), Math.abs(xx - xxmin),<a name="line.3457"></a>
- <span class="sourceLineNo">3458</span> Math.abs(yy - yymax));<a name="line.3458"></a>
- <span class="sourceLineNo">3459</span> }<a name="line.3459"></a>
- <span class="sourceLineNo">3460</span> somethingToDraw = true;<a name="line.3460"></a>
- <span class="sourceLineNo">3461</span> }<a name="line.3461"></a>
- <span class="sourceLineNo">3462</span> }<a name="line.3462"></a>
- <span class="sourceLineNo">3463</span> if (this.quadrantPaint[1] != null) {<a name="line.3463"></a>
- <span class="sourceLineNo">3464</span> if (x < xmax && y < ymax) {<a name="line.3464"></a>
- <span class="sourceLineNo">3465</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3465"></a>
- <span class="sourceLineNo">3466</span> r[1] = new Rectangle2D.Double(Math.min(yymax, yy),<a name="line.3466"></a>
- <span class="sourceLineNo">3467</span> Math.min(xxmax, xx), Math.abs(yy - yymax),<a name="line.3467"></a>
- <span class="sourceLineNo">3468</span> Math.abs(xx - xxmax));<a name="line.3468"></a>
- <span class="sourceLineNo">3469</span> }<a name="line.3469"></a>
- <span class="sourceLineNo">3470</span> else { // PlotOrientation.VERTICAL<a name="line.3470"></a>
- <span class="sourceLineNo">3471</span> r[1] = new Rectangle2D.Double(Math.min(xx, xxmax),<a name="line.3471"></a>
- <span class="sourceLineNo">3472</span> Math.min(yymax, yy), Math.abs(xx - xxmax),<a name="line.3472"></a>
- <span class="sourceLineNo">3473</span> Math.abs(yy - yymax));<a name="line.3473"></a>
- <span class="sourceLineNo">3474</span> }<a name="line.3474"></a>
- <span class="sourceLineNo">3475</span> somethingToDraw = true;<a name="line.3475"></a>
- <span class="sourceLineNo">3476</span> }<a name="line.3476"></a>
- <span class="sourceLineNo">3477</span> }<a name="line.3477"></a>
- <span class="sourceLineNo">3478</span> if (this.quadrantPaint[2] != null) {<a name="line.3478"></a>
- <span class="sourceLineNo">3479</span> if (x > xmin && y > ymin) {<a name="line.3479"></a>
- <span class="sourceLineNo">3480</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3480"></a>
- <span class="sourceLineNo">3481</span> r[2] = new Rectangle2D.Double(Math.min(yymin, yy),<a name="line.3481"></a>
- <span class="sourceLineNo">3482</span> Math.min(xxmin, xx), Math.abs(yy - yymin),<a name="line.3482"></a>
- <span class="sourceLineNo">3483</span> Math.abs(xx - xxmin));<a name="line.3483"></a>
- <span class="sourceLineNo">3484</span> }<a name="line.3484"></a>
- <span class="sourceLineNo">3485</span> else { // PlotOrientation.VERTICAL<a name="line.3485"></a>
- <span class="sourceLineNo">3486</span> r[2] = new Rectangle2D.Double(Math.min(xxmin, xx),<a name="line.3486"></a>
- <span class="sourceLineNo">3487</span> Math.min(yymin, yy), Math.abs(xx - xxmin),<a name="line.3487"></a>
- <span class="sourceLineNo">3488</span> Math.abs(yy - yymin));<a name="line.3488"></a>
- <span class="sourceLineNo">3489</span> }<a name="line.3489"></a>
- <span class="sourceLineNo">3490</span> somethingToDraw = true;<a name="line.3490"></a>
- <span class="sourceLineNo">3491</span> }<a name="line.3491"></a>
- <span class="sourceLineNo">3492</span> }<a name="line.3492"></a>
- <span class="sourceLineNo">3493</span> if (this.quadrantPaint[3] != null) {<a name="line.3493"></a>
- <span class="sourceLineNo">3494</span> if (x < xmax && y > ymin) {<a name="line.3494"></a>
- <span class="sourceLineNo">3495</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3495"></a>
- <span class="sourceLineNo">3496</span> r[3] = new Rectangle2D.Double(Math.min(yymin, yy),<a name="line.3496"></a>
- <span class="sourceLineNo">3497</span> Math.min(xxmax, xx), Math.abs(yy - yymin),<a name="line.3497"></a>
- <span class="sourceLineNo">3498</span> Math.abs(xx - xxmax));<a name="line.3498"></a>
- <span class="sourceLineNo">3499</span> }<a name="line.3499"></a>
- <span class="sourceLineNo">3500</span> else { // PlotOrientation.VERTICAL<a name="line.3500"></a>
- <span class="sourceLineNo">3501</span> r[3] = new Rectangle2D.Double(Math.min(xx, xxmax),<a name="line.3501"></a>
- <span class="sourceLineNo">3502</span> Math.min(yymin, yy), Math.abs(xx - xxmax),<a name="line.3502"></a>
- <span class="sourceLineNo">3503</span> Math.abs(yy - yymin));<a name="line.3503"></a>
- <span class="sourceLineNo">3504</span> }<a name="line.3504"></a>
- <span class="sourceLineNo">3505</span> somethingToDraw = true;<a name="line.3505"></a>
- <span class="sourceLineNo">3506</span> }<a name="line.3506"></a>
- <span class="sourceLineNo">3507</span> }<a name="line.3507"></a>
- <span class="sourceLineNo">3508</span> if (somethingToDraw) {<a name="line.3508"></a>
- <span class="sourceLineNo">3509</span> Composite originalComposite = g2.getComposite();<a name="line.3509"></a>
- <span class="sourceLineNo">3510</span> g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,<a name="line.3510"></a>
- <span class="sourceLineNo">3511</span> getBackgroundAlpha()));<a name="line.3511"></a>
- <span class="sourceLineNo">3512</span> for (int i = 0; i < 4; i++) {<a name="line.3512"></a>
- <span class="sourceLineNo">3513</span> if (this.quadrantPaint[i] != null && r[i] != null) {<a name="line.3513"></a>
- <span class="sourceLineNo">3514</span> g2.setPaint(this.quadrantPaint[i]);<a name="line.3514"></a>
- <span class="sourceLineNo">3515</span> g2.fill(r[i]);<a name="line.3515"></a>
- <span class="sourceLineNo">3516</span> }<a name="line.3516"></a>
- <span class="sourceLineNo">3517</span> }<a name="line.3517"></a>
- <span class="sourceLineNo">3518</span> g2.setComposite(originalComposite);<a name="line.3518"></a>
- <span class="sourceLineNo">3519</span> }<a name="line.3519"></a>
- <span class="sourceLineNo">3520</span> }<a name="line.3520"></a>
- <span class="sourceLineNo">3521</span><a name="line.3521"></a>
- <span class="sourceLineNo">3522</span> /**<a name="line.3522"></a>
- <span class="sourceLineNo">3523</span> * Draws the domain tick bands, if any.<a name="line.3523"></a>
- <span class="sourceLineNo">3524</span> *<a name="line.3524"></a>
- <span class="sourceLineNo">3525</span> * @param g2 the graphics device.<a name="line.3525"></a>
- <span class="sourceLineNo">3526</span> * @param dataArea the data area.<a name="line.3526"></a>
- <span class="sourceLineNo">3527</span> * @param ticks the ticks.<a name="line.3527"></a>
- <span class="sourceLineNo">3528</span> *<a name="line.3528"></a>
- <span class="sourceLineNo">3529</span> * @see #setDomainTickBandPaint(Paint)<a name="line.3529"></a>
- <span class="sourceLineNo">3530</span> */<a name="line.3530"></a>
- <span class="sourceLineNo">3531</span> public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea,<a name="line.3531"></a>
- <span class="sourceLineNo">3532</span> List ticks) {<a name="line.3532"></a>
- <span class="sourceLineNo">3533</span> Paint bandPaint = getDomainTickBandPaint();<a name="line.3533"></a>
- <span class="sourceLineNo">3534</span> if (bandPaint != null) {<a name="line.3534"></a>
- <span class="sourceLineNo">3535</span> boolean fillBand = false;<a name="line.3535"></a>
- <span class="sourceLineNo">3536</span> ValueAxis xAxis = getDomainAxis();<a name="line.3536"></a>
- <span class="sourceLineNo">3537</span> double previous = xAxis.getLowerBound();<a name="line.3537"></a>
- <span class="sourceLineNo">3538</span> Iterator iterator = ticks.iterator();<a name="line.3538"></a>
- <span class="sourceLineNo">3539</span> while (iterator.hasNext()) {<a name="line.3539"></a>
- <span class="sourceLineNo">3540</span> ValueTick tick = (ValueTick) iterator.next();<a name="line.3540"></a>
- <span class="sourceLineNo">3541</span> double current = tick.getValue();<a name="line.3541"></a>
- <span class="sourceLineNo">3542</span> if (fillBand) {<a name="line.3542"></a>
- <span class="sourceLineNo">3543</span> getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,<a name="line.3543"></a>
- <span class="sourceLineNo">3544</span> previous, current);<a name="line.3544"></a>
- <span class="sourceLineNo">3545</span> }<a name="line.3545"></a>
- <span class="sourceLineNo">3546</span> previous = current;<a name="line.3546"></a>
- <span class="sourceLineNo">3547</span> fillBand = !fillBand;<a name="line.3547"></a>
- <span class="sourceLineNo">3548</span> }<a name="line.3548"></a>
- <span class="sourceLineNo">3549</span> double end = xAxis.getUpperBound();<a name="line.3549"></a>
- <span class="sourceLineNo">3550</span> if (fillBand) {<a name="line.3550"></a>
- <span class="sourceLineNo">3551</span> getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,<a name="line.3551"></a>
- <span class="sourceLineNo">3552</span> previous, end);<a name="line.3552"></a>
- <span class="sourceLineNo">3553</span> }<a name="line.3553"></a>
- <span class="sourceLineNo">3554</span> }<a name="line.3554"></a>
- <span class="sourceLineNo">3555</span> }<a name="line.3555"></a>
- <span class="sourceLineNo">3556</span><a name="line.3556"></a>
- <span class="sourceLineNo">3557</span> /**<a name="line.3557"></a>
- <span class="sourceLineNo">3558</span> * Draws the range tick bands, if any.<a name="line.3558"></a>
- <span class="sourceLineNo">3559</span> *<a name="line.3559"></a>
- <span class="sourceLineNo">3560</span> * @param g2 the graphics device.<a name="line.3560"></a>
- <span class="sourceLineNo">3561</span> * @param dataArea the data area.<a name="line.3561"></a>
- <span class="sourceLineNo">3562</span> * @param ticks the ticks.<a name="line.3562"></a>
- <span class="sourceLineNo">3563</span> *<a name="line.3563"></a>
- <span class="sourceLineNo">3564</span> * @see #setRangeTickBandPaint(Paint)<a name="line.3564"></a>
- <span class="sourceLineNo">3565</span> */<a name="line.3565"></a>
- <span class="sourceLineNo">3566</span> public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea,<a name="line.3566"></a>
- <span class="sourceLineNo">3567</span> List ticks) {<a name="line.3567"></a>
- <span class="sourceLineNo">3568</span> Paint bandPaint = getRangeTickBandPaint();<a name="line.3568"></a>
- <span class="sourceLineNo">3569</span> if (bandPaint != null) {<a name="line.3569"></a>
- <span class="sourceLineNo">3570</span> boolean fillBand = false;<a name="line.3570"></a>
- <span class="sourceLineNo">3571</span> ValueAxis axis = getRangeAxis();<a name="line.3571"></a>
- <span class="sourceLineNo">3572</span> double previous = axis.getLowerBound();<a name="line.3572"></a>
- <span class="sourceLineNo">3573</span> Iterator iterator = ticks.iterator();<a name="line.3573"></a>
- <span class="sourceLineNo">3574</span> while (iterator.hasNext()) {<a name="line.3574"></a>
- <span class="sourceLineNo">3575</span> ValueTick tick = (ValueTick) iterator.next();<a name="line.3575"></a>
- <span class="sourceLineNo">3576</span> double current = tick.getValue();<a name="line.3576"></a>
- <span class="sourceLineNo">3577</span> if (fillBand) {<a name="line.3577"></a>
- <span class="sourceLineNo">3578</span> getRenderer().fillRangeGridBand(g2, this, axis, dataArea,<a name="line.3578"></a>
- <span class="sourceLineNo">3579</span> previous, current);<a name="line.3579"></a>
- <span class="sourceLineNo">3580</span> }<a name="line.3580"></a>
- <span class="sourceLineNo">3581</span> previous = current;<a name="line.3581"></a>
- <span class="sourceLineNo">3582</span> fillBand = !fillBand;<a name="line.3582"></a>
- <span class="sourceLineNo">3583</span> }<a name="line.3583"></a>
- <span class="sourceLineNo">3584</span> double end = axis.getUpperBound();<a name="line.3584"></a>
- <span class="sourceLineNo">3585</span> if (fillBand) {<a name="line.3585"></a>
- <span class="sourceLineNo">3586</span> getRenderer().fillRangeGridBand(g2, this, axis, dataArea,<a name="line.3586"></a>
- <span class="sourceLineNo">3587</span> previous, end);<a name="line.3587"></a>
- <span class="sourceLineNo">3588</span> }<a name="line.3588"></a>
- <span class="sourceLineNo">3589</span> }<a name="line.3589"></a>
- <span class="sourceLineNo">3590</span> }<a name="line.3590"></a>
- <span class="sourceLineNo">3591</span><a name="line.3591"></a>
- <span class="sourceLineNo">3592</span> /**<a name="line.3592"></a>
- <span class="sourceLineNo">3593</span> * A utility method for drawing the axes.<a name="line.3593"></a>
- <span class="sourceLineNo">3594</span> *<a name="line.3594"></a>
- <span class="sourceLineNo">3595</span> * @param g2 the graphics device (<code>null</code> not permitted).<a name="line.3595"></a>
- <span class="sourceLineNo">3596</span> * @param plotArea the plot area (<code>null</code> not permitted).<a name="line.3596"></a>
- <span class="sourceLineNo">3597</span> * @param dataArea the data area (<code>null</code> not permitted).<a name="line.3597"></a>
- <span class="sourceLineNo">3598</span> * @param plotState collects information about the plot (<code>null</code><a name="line.3598"></a>
- <span class="sourceLineNo">3599</span> * permitted).<a name="line.3599"></a>
- <span class="sourceLineNo">3600</span> *<a name="line.3600"></a>
- <span class="sourceLineNo">3601</span> * @return A map containing the state for each axis drawn.<a name="line.3601"></a>
- <span class="sourceLineNo">3602</span> */<a name="line.3602"></a>
- <span class="sourceLineNo">3603</span> protected Map<Axis, AxisState> drawAxes(Graphics2D g2, Rectangle2D plotArea,<a name="line.3603"></a>
- <span class="sourceLineNo">3604</span> Rectangle2D dataArea, PlotRenderingInfo plotState) {<a name="line.3604"></a>
- <span class="sourceLineNo">3605</span><a name="line.3605"></a>
- <span class="sourceLineNo">3606</span> AxisCollection axisCollection = new AxisCollection();<a name="line.3606"></a>
- <span class="sourceLineNo">3607</span><a name="line.3607"></a>
- <span class="sourceLineNo">3608</span> // add domain axes to lists...<a name="line.3608"></a>
- <span class="sourceLineNo">3609</span> for (ValueAxis axis : this.domainAxes.values()) {<a name="line.3609"></a>
- <span class="sourceLineNo">3610</span> if (axis != null) {<a name="line.3610"></a>
- <span class="sourceLineNo">3611</span> int axisIndex = findDomainAxisIndex(axis);<a name="line.3611"></a>
- <span class="sourceLineNo">3612</span> axisCollection.add(axis, getDomainAxisEdge(axisIndex));<a name="line.3612"></a>
- <span class="sourceLineNo">3613</span> }<a name="line.3613"></a>
- <span class="sourceLineNo">3614</span> }<a name="line.3614"></a>
- <span class="sourceLineNo">3615</span><a name="line.3615"></a>
- <span class="sourceLineNo">3616</span> // add range axes to lists...<a name="line.3616"></a>
- <span class="sourceLineNo">3617</span> for (ValueAxis axis : this.rangeAxes.values()) {<a name="line.3617"></a>
- <span class="sourceLineNo">3618</span> if (axis != null) {<a name="line.3618"></a>
- <span class="sourceLineNo">3619</span> int axisIndex = findRangeAxisIndex(axis);<a name="line.3619"></a>
- <span class="sourceLineNo">3620</span> axisCollection.add(axis, getRangeAxisEdge(axisIndex));<a name="line.3620"></a>
- <span class="sourceLineNo">3621</span> }<a name="line.3621"></a>
- <span class="sourceLineNo">3622</span> }<a name="line.3622"></a>
- <span class="sourceLineNo">3623</span><a name="line.3623"></a>
- <span class="sourceLineNo">3624</span> Map axisStateMap = new HashMap();<a name="line.3624"></a>
- <span class="sourceLineNo">3625</span><a name="line.3625"></a>
- <span class="sourceLineNo">3626</span> // draw the top axes<a name="line.3626"></a>
- <span class="sourceLineNo">3627</span> double cursor = dataArea.getMinY() - this.axisOffset.calculateTopOutset(<a name="line.3627"></a>
- <span class="sourceLineNo">3628</span> dataArea.getHeight());<a name="line.3628"></a>
- <span class="sourceLineNo">3629</span> Iterator iterator = axisCollection.getAxesAtTop().iterator();<a name="line.3629"></a>
- <span class="sourceLineNo">3630</span> while (iterator.hasNext()) {<a name="line.3630"></a>
- <span class="sourceLineNo">3631</span> ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3631"></a>
- <span class="sourceLineNo">3632</span> AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3632"></a>
- <span class="sourceLineNo">3633</span> RectangleEdge.TOP, plotState);<a name="line.3633"></a>
- <span class="sourceLineNo">3634</span> cursor = info.getCursor();<a name="line.3634"></a>
- <span class="sourceLineNo">3635</span> axisStateMap.put(axis, info);<a name="line.3635"></a>
- <span class="sourceLineNo">3636</span> }<a name="line.3636"></a>
- <span class="sourceLineNo">3637</span><a name="line.3637"></a>
- <span class="sourceLineNo">3638</span> // draw the bottom axes<a name="line.3638"></a>
- <span class="sourceLineNo">3639</span> cursor = dataArea.getMaxY()<a name="line.3639"></a>
- <span class="sourceLineNo">3640</span> + this.axisOffset.calculateBottomOutset(dataArea.getHeight());<a name="line.3640"></a>
- <span class="sourceLineNo">3641</span> iterator = axisCollection.getAxesAtBottom().iterator();<a name="line.3641"></a>
- <span class="sourceLineNo">3642</span> while (iterator.hasNext()) {<a name="line.3642"></a>
- <span class="sourceLineNo">3643</span> ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3643"></a>
- <span class="sourceLineNo">3644</span> AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3644"></a>
- <span class="sourceLineNo">3645</span> RectangleEdge.BOTTOM, plotState);<a name="line.3645"></a>
- <span class="sourceLineNo">3646</span> cursor = info.getCursor();<a name="line.3646"></a>
- <span class="sourceLineNo">3647</span> axisStateMap.put(axis, info);<a name="line.3647"></a>
- <span class="sourceLineNo">3648</span> }<a name="line.3648"></a>
- <span class="sourceLineNo">3649</span><a name="line.3649"></a>
- <span class="sourceLineNo">3650</span> // draw the left axes<a name="line.3650"></a>
- <span class="sourceLineNo">3651</span> cursor = dataArea.getMinX()<a name="line.3651"></a>
- <span class="sourceLineNo">3652</span> - this.axisOffset.calculateLeftOutset(dataArea.getWidth());<a name="line.3652"></a>
- <span class="sourceLineNo">3653</span> iterator = axisCollection.getAxesAtLeft().iterator();<a name="line.3653"></a>
- <span class="sourceLineNo">3654</span> while (iterator.hasNext()) {<a name="line.3654"></a>
- <span class="sourceLineNo">3655</span> ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3655"></a>
- <span class="sourceLineNo">3656</span> AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3656"></a>
- <span class="sourceLineNo">3657</span> RectangleEdge.LEFT, plotState);<a name="line.3657"></a>
- <span class="sourceLineNo">3658</span> cursor = info.getCursor();<a name="line.3658"></a>
- <span class="sourceLineNo">3659</span> axisStateMap.put(axis, info);<a name="line.3659"></a>
- <span class="sourceLineNo">3660</span> }<a name="line.3660"></a>
- <span class="sourceLineNo">3661</span><a name="line.3661"></a>
- <span class="sourceLineNo">3662</span> // draw the right axes<a name="line.3662"></a>
- <span class="sourceLineNo">3663</span> cursor = dataArea.getMaxX()<a name="line.3663"></a>
- <span class="sourceLineNo">3664</span> + this.axisOffset.calculateRightOutset(dataArea.getWidth());<a name="line.3664"></a>
- <span class="sourceLineNo">3665</span> iterator = axisCollection.getAxesAtRight().iterator();<a name="line.3665"></a>
- <span class="sourceLineNo">3666</span> while (iterator.hasNext()) {<a name="line.3666"></a>
- <span class="sourceLineNo">3667</span> ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3667"></a>
- <span class="sourceLineNo">3668</span> AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3668"></a>
- <span class="sourceLineNo">3669</span> RectangleEdge.RIGHT, plotState);<a name="line.3669"></a>
- <span class="sourceLineNo">3670</span> cursor = info.getCursor();<a name="line.3670"></a>
- <span class="sourceLineNo">3671</span> axisStateMap.put(axis, info);<a name="line.3671"></a>
- <span class="sourceLineNo">3672</span> }<a name="line.3672"></a>
- <span class="sourceLineNo">3673</span><a name="line.3673"></a>
- <span class="sourceLineNo">3674</span> return axisStateMap;<a name="line.3674"></a>
- <span class="sourceLineNo">3675</span> }<a name="line.3675"></a>
- <span class="sourceLineNo">3676</span><a name="line.3676"></a>
- <span class="sourceLineNo">3677</span> /**<a name="line.3677"></a>
- <span class="sourceLineNo">3678</span> * Draws a representation of the data within the dataArea region, using the<a name="line.3678"></a>
- <span class="sourceLineNo">3679</span> * current renderer.<a name="line.3679"></a>
- <span class="sourceLineNo">3680</span> * <P><a name="line.3680"></a>
- <span class="sourceLineNo">3681</span> * The <code>info</code> and <code>crosshairState</code> arguments may be<a name="line.3681"></a>
- <span class="sourceLineNo">3682</span> * <code>null</code>.<a name="line.3682"></a>
- <span class="sourceLineNo">3683</span> *<a name="line.3683"></a>
- <span class="sourceLineNo">3684</span> * @param g2 the graphics device.<a name="line.3684"></a>
- <span class="sourceLineNo">3685</span> * @param dataArea the region in which the data is to be drawn.<a name="line.3685"></a>
- <span class="sourceLineNo">3686</span> * @param index the dataset index.<a name="line.3686"></a>
- <span class="sourceLineNo">3687</span> * @param info an optional object for collection dimension information.<a name="line.3687"></a>
- <span class="sourceLineNo">3688</span> * @param crosshairState collects crosshair information<a name="line.3688"></a>
- <span class="sourceLineNo">3689</span> * (<code>null</code> permitted).<a name="line.3689"></a>
- <span class="sourceLineNo">3690</span> *<a name="line.3690"></a>
- <span class="sourceLineNo">3691</span> * @return A flag that indicates whether any data was actually rendered.<a name="line.3691"></a>
- <span class="sourceLineNo">3692</span> */<a name="line.3692"></a>
- <span class="sourceLineNo">3693</span> public boolean render(Graphics2D g2, Rectangle2D dataArea, int index,<a name="line.3693"></a>
- <span class="sourceLineNo">3694</span> PlotRenderingInfo info, CrosshairState crosshairState) {<a name="line.3694"></a>
- <span class="sourceLineNo">3695</span><a name="line.3695"></a>
- <span class="sourceLineNo">3696</span> boolean foundData = false;<a name="line.3696"></a>
- <span class="sourceLineNo">3697</span> XYDataset dataset = getDataset(index);<a name="line.3697"></a>
- <span class="sourceLineNo">3698</span> if (!DatasetUtilities.isEmptyOrNull(dataset)) {<a name="line.3698"></a>
- <span class="sourceLineNo">3699</span> foundData = true;<a name="line.3699"></a>
- <span class="sourceLineNo">3700</span> ValueAxis xAxis = getDomainAxisForDataset(index);<a name="line.3700"></a>
- <span class="sourceLineNo">3701</span> ValueAxis yAxis = getRangeAxisForDataset(index);<a name="line.3701"></a>
- <span class="sourceLineNo">3702</span> if (xAxis == null || yAxis == null) {<a name="line.3702"></a>
- <span class="sourceLineNo">3703</span> return foundData; // can't render anything without axes<a name="line.3703"></a>
- <span class="sourceLineNo">3704</span> }<a name="line.3704"></a>
- <span class="sourceLineNo">3705</span> XYItemRenderer renderer = getRenderer(index);<a name="line.3705"></a>
- <span class="sourceLineNo">3706</span> if (renderer == null) {<a name="line.3706"></a>
- <span class="sourceLineNo">3707</span> renderer = getRenderer();<a name="line.3707"></a>
- <span class="sourceLineNo">3708</span> if (renderer == null) { // no default renderer available<a name="line.3708"></a>
- <span class="sourceLineNo">3709</span> return foundData;<a name="line.3709"></a>
- <span class="sourceLineNo">3710</span> }<a name="line.3710"></a>
- <span class="sourceLineNo">3711</span> }<a name="line.3711"></a>
- <span class="sourceLineNo">3712</span><a name="line.3712"></a>
- <span class="sourceLineNo">3713</span> XYItemRendererState state = renderer.initialise(g2, dataArea, this,<a name="line.3713"></a>
- <span class="sourceLineNo">3714</span> dataset, info);<a name="line.3714"></a>
- <span class="sourceLineNo">3715</span> int passCount = renderer.getPassCount();<a name="line.3715"></a>
- <span class="sourceLineNo">3716</span><a name="line.3716"></a>
- <span class="sourceLineNo">3717</span> SeriesRenderingOrder seriesOrder = getSeriesRenderingOrder();<a name="line.3717"></a>
- <span class="sourceLineNo">3718</span> if (seriesOrder == SeriesRenderingOrder.REVERSE) {<a name="line.3718"></a>
- <span class="sourceLineNo">3719</span> //render series in reverse order<a name="line.3719"></a>
- <span class="sourceLineNo">3720</span> for (int pass = 0; pass < passCount; pass++) {<a name="line.3720"></a>
- <span class="sourceLineNo">3721</span> int seriesCount = dataset.getSeriesCount();<a name="line.3721"></a>
- <span class="sourceLineNo">3722</span> for (int series = seriesCount - 1; series >= 0; series--) {<a name="line.3722"></a>
- <span class="sourceLineNo">3723</span> int firstItem = 0;<a name="line.3723"></a>
- <span class="sourceLineNo">3724</span> int lastItem = dataset.getItemCount(series) - 1;<a name="line.3724"></a>
- <span class="sourceLineNo">3725</span> if (lastItem == -1) {<a name="line.3725"></a>
- <span class="sourceLineNo">3726</span> continue;<a name="line.3726"></a>
- <span class="sourceLineNo">3727</span> }<a name="line.3727"></a>
- <span class="sourceLineNo">3728</span> if (state.getProcessVisibleItemsOnly()) {<a name="line.3728"></a>
- <span class="sourceLineNo">3729</span> int[] itemBounds = RendererUtilities.findLiveItems(<a name="line.3729"></a>
- <span class="sourceLineNo">3730</span> dataset, series, xAxis.getLowerBound(),<a name="line.3730"></a>
- <span class="sourceLineNo">3731</span> xAxis.getUpperBound());<a name="line.3731"></a>
- <span class="sourceLineNo">3732</span> firstItem = Math.max(itemBounds[0] - 1, 0);<a name="line.3732"></a>
- <span class="sourceLineNo">3733</span> lastItem = Math.min(itemBounds[1] + 1, lastItem);<a name="line.3733"></a>
- <span class="sourceLineNo">3734</span> }<a name="line.3734"></a>
- <span class="sourceLineNo">3735</span> state.startSeriesPass(dataset, series, firstItem,<a name="line.3735"></a>
- <span class="sourceLineNo">3736</span> lastItem, pass, passCount);<a name="line.3736"></a>
- <span class="sourceLineNo">3737</span> for (int item = firstItem; item <= lastItem; item++) {<a name="line.3737"></a>
- <span class="sourceLineNo">3738</span> renderer.drawItem(g2, state, dataArea, info,<a name="line.3738"></a>
- <span class="sourceLineNo">3739</span> this, xAxis, yAxis, dataset, series, item,<a name="line.3739"></a>
- <span class="sourceLineNo">3740</span> crosshairState, pass);<a name="line.3740"></a>
- <span class="sourceLineNo">3741</span> }<a name="line.3741"></a>
- <span class="sourceLineNo">3742</span> state.endSeriesPass(dataset, series, firstItem,<a name="line.3742"></a>
- <span class="sourceLineNo">3743</span> lastItem, pass, passCount);<a name="line.3743"></a>
- <span class="sourceLineNo">3744</span> }<a name="line.3744"></a>
- <span class="sourceLineNo">3745</span> }<a name="line.3745"></a>
- <span class="sourceLineNo">3746</span> }<a name="line.3746"></a>
- <span class="sourceLineNo">3747</span> else {<a name="line.3747"></a>
- <span class="sourceLineNo">3748</span> //render series in forward order<a name="line.3748"></a>
- <span class="sourceLineNo">3749</span> for (int pass = 0; pass < passCount; pass++) {<a name="line.3749"></a>
- <span class="sourceLineNo">3750</span> int seriesCount = dataset.getSeriesCount();<a name="line.3750"></a>
- <span class="sourceLineNo">3751</span> for (int series = 0; series < seriesCount; series++) {<a name="line.3751"></a>
- <span class="sourceLineNo">3752</span> int firstItem = 0;<a name="line.3752"></a>
- <span class="sourceLineNo">3753</span> int lastItem = dataset.getItemCount(series) - 1;<a name="line.3753"></a>
- <span class="sourceLineNo">3754</span> if (state.getProcessVisibleItemsOnly()) {<a name="line.3754"></a>
- <span class="sourceLineNo">3755</span> int[] itemBounds = RendererUtilities.findLiveItems(<a name="line.3755"></a>
- <span class="sourceLineNo">3756</span> dataset, series, xAxis.getLowerBound(),<a name="line.3756"></a>
- <span class="sourceLineNo">3757</span> xAxis.getUpperBound());<a name="line.3757"></a>
- <span class="sourceLineNo">3758</span> firstItem = Math.max(itemBounds[0] - 1, 0);<a name="line.3758"></a>
- <span class="sourceLineNo">3759</span> lastItem = Math.min(itemBounds[1] + 1, lastItem);<a name="line.3759"></a>
- <span class="sourceLineNo">3760</span> }<a name="line.3760"></a>
- <span class="sourceLineNo">3761</span> state.startSeriesPass(dataset, series, firstItem,<a name="line.3761"></a>
- <span class="sourceLineNo">3762</span> lastItem, pass, passCount);<a name="line.3762"></a>
- <span class="sourceLineNo">3763</span> for (int item = firstItem; item <= lastItem; item++) {<a name="line.3763"></a>
- <span class="sourceLineNo">3764</span> renderer.drawItem(g2, state, dataArea, info,<a name="line.3764"></a>
- <span class="sourceLineNo">3765</span> this, xAxis, yAxis, dataset, series, item,<a name="line.3765"></a>
- <span class="sourceLineNo">3766</span> crosshairState, pass);<a name="line.3766"></a>
- <span class="sourceLineNo">3767</span> }<a name="line.3767"></a>
- <span class="sourceLineNo">3768</span> state.endSeriesPass(dataset, series, firstItem,<a name="line.3768"></a>
- <span class="sourceLineNo">3769</span> lastItem, pass, passCount);<a name="line.3769"></a>
- <span class="sourceLineNo">3770</span> }<a name="line.3770"></a>
- <span class="sourceLineNo">3771</span> }<a name="line.3771"></a>
- <span class="sourceLineNo">3772</span> }<a name="line.3772"></a>
- <span class="sourceLineNo">3773</span> }<a name="line.3773"></a>
- <span class="sourceLineNo">3774</span> return foundData;<a name="line.3774"></a>
- <span class="sourceLineNo">3775</span> }<a name="line.3775"></a>
- <span class="sourceLineNo">3776</span><a name="line.3776"></a>
- <span class="sourceLineNo">3777</span> /**<a name="line.3777"></a>
- <span class="sourceLineNo">3778</span> * Returns the domain axis for a dataset.<a name="line.3778"></a>
- <span class="sourceLineNo">3779</span> *<a name="line.3779"></a>
- <span class="sourceLineNo">3780</span> * @param index the dataset index (must be &gt;= 0).<a name="line.3780"></a>
- <span class="sourceLineNo">3781</span> *<a name="line.3781"></a>
- <span class="sourceLineNo">3782</span> * @return The axis.<a name="line.3782"></a>
- <span class="sourceLineNo">3783</span> */<a name="line.3783"></a>
- <span class="sourceLineNo">3784</span> public ValueAxis getDomainAxisForDataset(int index) {<a name="line.3784"></a>
- <span class="sourceLineNo">3785</span> ParamChecks.requireNonNegative(index, "index");<a name="line.3785"></a>
- <span class="sourceLineNo">3786</span> ValueAxis valueAxis;<a name="line.3786"></a>
- <span class="sourceLineNo">3787</span> List axisIndices = (List) this.datasetToDomainAxesMap.get(<a name="line.3787"></a>
- <span class="sourceLineNo">3788</span> new Integer(index));<a name="line.3788"></a>
- <span class="sourceLineNo">3789</span> if (axisIndices != null) {<a name="line.3789"></a>
- <span class="sourceLineNo">3790</span> // the first axis in the list is used for data <--> Java2D<a name="line.3790"></a>
- <span class="sourceLineNo">3791</span> Integer axisIndex = (Integer) axisIndices.get(0);<a name="line.3791"></a>
- <span class="sourceLineNo">3792</span> valueAxis = getDomainAxis(axisIndex.intValue());<a name="line.3792"></a>
- <span class="sourceLineNo">3793</span> }<a name="line.3793"></a>
- <span class="sourceLineNo">3794</span> else {<a name="line.3794"></a>
- <span class="sourceLineNo">3795</span> valueAxis = getDomainAxis(0);<a name="line.3795"></a>
- <span class="sourceLineNo">3796</span> }<a name="line.3796"></a>
- <span class="sourceLineNo">3797</span> return valueAxis;<a name="line.3797"></a>
- <span class="sourceLineNo">3798</span> }<a name="line.3798"></a>
- <span class="sourceLineNo">3799</span><a name="line.3799"></a>
- <span class="sourceLineNo">3800</span> /**<a name="line.3800"></a>
- <span class="sourceLineNo">3801</span> * Returns the range axis for a dataset.<a name="line.3801"></a>
- <span class="sourceLineNo">3802</span> *<a name="line.3802"></a>
- <span class="sourceLineNo">3803</span> * @param index the dataset index (must be &gt;= 0).<a name="line.3803"></a>
- <span class="sourceLineNo">3804</span> *<a name="line.3804"></a>
- <span class="sourceLineNo">3805</span> * @return The axis.<a name="line.3805"></a>
- <span class="sourceLineNo">3806</span> */<a name="line.3806"></a>
- <span class="sourceLineNo">3807</span> public ValueAxis getRangeAxisForDataset(int index) {<a name="line.3807"></a>
- <span class="sourceLineNo">3808</span> ParamChecks.requireNonNegative(index, "index");<a name="line.3808"></a>
- <span class="sourceLineNo">3809</span> ValueAxis valueAxis;<a name="line.3809"></a>
- <span class="sourceLineNo">3810</span> List axisIndices = (List) this.datasetToRangeAxesMap.get(<a name="line.3810"></a>
- <span class="sourceLineNo">3811</span> new Integer(index));<a name="line.3811"></a>
- <span class="sourceLineNo">3812</span> if (axisIndices != null) {<a name="line.3812"></a>
- <span class="sourceLineNo">3813</span> // the first axis in the list is used for data <--> Java2D<a name="line.3813"></a>
- <span class="sourceLineNo">3814</span> Integer axisIndex = (Integer) axisIndices.get(0);<a name="line.3814"></a>
- <span class="sourceLineNo">3815</span> valueAxis = getRangeAxis(axisIndex.intValue());<a name="line.3815"></a>
- <span class="sourceLineNo">3816</span> }<a name="line.3816"></a>
- <span class="sourceLineNo">3817</span> else {<a name="line.3817"></a>
- <span class="sourceLineNo">3818</span> valueAxis = getRangeAxis(0);<a name="line.3818"></a>
- <span class="sourceLineNo">3819</span> }<a name="line.3819"></a>
- <span class="sourceLineNo">3820</span> return valueAxis;<a name="line.3820"></a>
- <span class="sourceLineNo">3821</span> }<a name="line.3821"></a>
- <span class="sourceLineNo">3822</span><a name="line.3822"></a>
- <span class="sourceLineNo">3823</span> /**<a name="line.3823"></a>
- <span class="sourceLineNo">3824</span> * Draws the gridlines for the plot, if they are visible.<a name="line.3824"></a>
- <span class="sourceLineNo">3825</span> *<a name="line.3825"></a>
- <span class="sourceLineNo">3826</span> * @param g2 the graphics device.<a name="line.3826"></a>
- <span class="sourceLineNo">3827</span> * @param dataArea the data area.<a name="line.3827"></a>
- <span class="sourceLineNo">3828</span> * @param ticks the ticks.<a name="line.3828"></a>
- <span class="sourceLineNo">3829</span> *<a name="line.3829"></a>
- <span class="sourceLineNo">3830</span> * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)<a name="line.3830"></a>
- <span class="sourceLineNo">3831</span> */<a name="line.3831"></a>
- <span class="sourceLineNo">3832</span> protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,<a name="line.3832"></a>
- <span class="sourceLineNo">3833</span> List ticks) {<a name="line.3833"></a>
- <span class="sourceLineNo">3834</span><a name="line.3834"></a>
- <span class="sourceLineNo">3835</span> // no renderer, no gridlines...<a name="line.3835"></a>
- <span class="sourceLineNo">3836</span> if (getRenderer() == null) {<a name="line.3836"></a>
- <span class="sourceLineNo">3837</span> return;<a name="line.3837"></a>
- <span class="sourceLineNo">3838</span> }<a name="line.3838"></a>
- <span class="sourceLineNo">3839</span><a name="line.3839"></a>
- <span class="sourceLineNo">3840</span> // draw the domain grid lines, if any...<a name="line.3840"></a>
- <span class="sourceLineNo">3841</span> if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {<a name="line.3841"></a>
- <span class="sourceLineNo">3842</span> Stroke gridStroke = null;<a name="line.3842"></a>
- <span class="sourceLineNo">3843</span> Paint gridPaint = null;<a name="line.3843"></a>
- <span class="sourceLineNo">3844</span> Iterator iterator = ticks.iterator();<a name="line.3844"></a>
- <span class="sourceLineNo">3845</span> boolean paintLine;<a name="line.3845"></a>
- <span class="sourceLineNo">3846</span> while (iterator.hasNext()) {<a name="line.3846"></a>
- <span class="sourceLineNo">3847</span> paintLine = false;<a name="line.3847"></a>
- <span class="sourceLineNo">3848</span> ValueTick tick = (ValueTick) iterator.next();<a name="line.3848"></a>
- <span class="sourceLineNo">3849</span> if ((tick.getTickType() == TickType.MINOR)<a name="line.3849"></a>
- <span class="sourceLineNo">3850</span> && isDomainMinorGridlinesVisible()) {<a name="line.3850"></a>
- <span class="sourceLineNo">3851</span> gridStroke = getDomainMinorGridlineStroke();<a name="line.3851"></a>
- <span class="sourceLineNo">3852</span> gridPaint = getDomainMinorGridlinePaint();<a name="line.3852"></a>
- <span class="sourceLineNo">3853</span> paintLine = true;<a name="line.3853"></a>
- <span class="sourceLineNo">3854</span> } else if ((tick.getTickType() == TickType.MAJOR)<a name="line.3854"></a>
- <span class="sourceLineNo">3855</span> && isDomainGridlinesVisible()) {<a name="line.3855"></a>
- <span class="sourceLineNo">3856</span> gridStroke = getDomainGridlineStroke();<a name="line.3856"></a>
- <span class="sourceLineNo">3857</span> gridPaint = getDomainGridlinePaint();<a name="line.3857"></a>
- <span class="sourceLineNo">3858</span> paintLine = true;<a name="line.3858"></a>
- <span class="sourceLineNo">3859</span> }<a name="line.3859"></a>
- <span class="sourceLineNo">3860</span> XYItemRenderer r = getRenderer();<a name="line.3860"></a>
- <span class="sourceLineNo">3861</span> if ((r instanceof AbstractXYItemRenderer) && paintLine) {<a name="line.3861"></a>
- <span class="sourceLineNo">3862</span> ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,<a name="line.3862"></a>
- <span class="sourceLineNo">3863</span> getDomainAxis(), dataArea, tick.getValue(),<a name="line.3863"></a>
- <span class="sourceLineNo">3864</span> gridPaint, gridStroke);<a name="line.3864"></a>
- <span class="sourceLineNo">3865</span> }<a name="line.3865"></a>
- <span class="sourceLineNo">3866</span> }<a name="line.3866"></a>
- <span class="sourceLineNo">3867</span> }<a name="line.3867"></a>
- <span class="sourceLineNo">3868</span> }<a name="line.3868"></a>
- <span class="sourceLineNo">3869</span><a name="line.3869"></a>
- <span class="sourceLineNo">3870</span> /**<a name="line.3870"></a>
- <span class="sourceLineNo">3871</span> * Draws the gridlines for the plot's primary range axis, if they are<a name="line.3871"></a>
- <span class="sourceLineNo">3872</span> * visible.<a name="line.3872"></a>
- <span class="sourceLineNo">3873</span> *<a name="line.3873"></a>
- <span class="sourceLineNo">3874</span> * @param g2 the graphics device.<a name="line.3874"></a>
- <span class="sourceLineNo">3875</span> * @param area the data area.<a name="line.3875"></a>
- <span class="sourceLineNo">3876</span> * @param ticks the ticks.<a name="line.3876"></a>
- <span class="sourceLineNo">3877</span> *<a name="line.3877"></a>
- <span class="sourceLineNo">3878</span> * @see #drawDomainGridlines(Graphics2D, Rectangle2D, List)<a name="line.3878"></a>
- <span class="sourceLineNo">3879</span> */<a name="line.3879"></a>
- <span class="sourceLineNo">3880</span> protected void drawRangeGridlines(Graphics2D g2, Rectangle2D area,<a name="line.3880"></a>
- <span class="sourceLineNo">3881</span> List ticks) {<a name="line.3881"></a>
- <span class="sourceLineNo">3882</span><a name="line.3882"></a>
- <span class="sourceLineNo">3883</span> // no renderer, no gridlines...<a name="line.3883"></a>
- <span class="sourceLineNo">3884</span> if (getRenderer() == null) {<a name="line.3884"></a>
- <span class="sourceLineNo">3885</span> return;<a name="line.3885"></a>
- <span class="sourceLineNo">3886</span> }<a name="line.3886"></a>
- <span class="sourceLineNo">3887</span><a name="line.3887"></a>
- <span class="sourceLineNo">3888</span> // draw the range grid lines, if any...<a name="line.3888"></a>
- <span class="sourceLineNo">3889</span> if (isRangeGridlinesVisible() || isRangeMinorGridlinesVisible()) {<a name="line.3889"></a>
- <span class="sourceLineNo">3890</span> Stroke gridStroke = null;<a name="line.3890"></a>
- <span class="sourceLineNo">3891</span> Paint gridPaint = null;<a name="line.3891"></a>
- <span class="sourceLineNo">3892</span> ValueAxis axis = getRangeAxis();<a name="line.3892"></a>
- <span class="sourceLineNo">3893</span> if (axis != null) {<a name="line.3893"></a>
- <span class="sourceLineNo">3894</span> Iterator iterator = ticks.iterator();<a name="line.3894"></a>
- <span class="sourceLineNo">3895</span> boolean paintLine;<a name="line.3895"></a>
- <span class="sourceLineNo">3896</span> while (iterator.hasNext()) {<a name="line.3896"></a>
- <span class="sourceLineNo">3897</span> paintLine = false;<a name="line.3897"></a>
- <span class="sourceLineNo">3898</span> ValueTick tick = (ValueTick) iterator.next();<a name="line.3898"></a>
- <span class="sourceLineNo">3899</span> if ((tick.getTickType() == TickType.MINOR)<a name="line.3899"></a>
- <span class="sourceLineNo">3900</span> && isRangeMinorGridlinesVisible()) {<a name="line.3900"></a>
- <span class="sourceLineNo">3901</span> gridStroke = getRangeMinorGridlineStroke();<a name="line.3901"></a>
- <span class="sourceLineNo">3902</span> gridPaint = getRangeMinorGridlinePaint();<a name="line.3902"></a>
- <span class="sourceLineNo">3903</span> paintLine = true;<a name="line.3903"></a>
- <span class="sourceLineNo">3904</span> } else if ((tick.getTickType() == TickType.MAJOR)<a name="line.3904"></a>
- <span class="sourceLineNo">3905</span> && isRangeGridlinesVisible()) {<a name="line.3905"></a>
- <span class="sourceLineNo">3906</span> gridStroke = getRangeGridlineStroke();<a name="line.3906"></a>
- <span class="sourceLineNo">3907</span> gridPaint = getRangeGridlinePaint();<a name="line.3907"></a>
- <span class="sourceLineNo">3908</span> paintLine = true;<a name="line.3908"></a>
- <span class="sourceLineNo">3909</span> }<a name="line.3909"></a>
- <span class="sourceLineNo">3910</span> if ((tick.getValue() != 0.0<a name="line.3910"></a>
- <span class="sourceLineNo">3911</span> || !isRangeZeroBaselineVisible()) && paintLine) {<a name="line.3911"></a>
- <span class="sourceLineNo">3912</span> getRenderer().drawRangeLine(g2, this, getRangeAxis(),<a name="line.3912"></a>
- <span class="sourceLineNo">3913</span> area, tick.getValue(), gridPaint, gridStroke);<a name="line.3913"></a>
- <span class="sourceLineNo">3914</span> }<a name="line.3914"></a>
- <span class="sourceLineNo">3915</span> }<a name="line.3915"></a>
- <span class="sourceLineNo">3916</span> }<a name="line.3916"></a>
- <span class="sourceLineNo">3917</span> }<a name="line.3917"></a>
- <span class="sourceLineNo">3918</span> }<a name="line.3918"></a>
- <span class="sourceLineNo">3919</span><a name="line.3919"></a>
- <span class="sourceLineNo">3920</span> /**<a name="line.3920"></a>
- <span class="sourceLineNo">3921</span> * Draws a base line across the chart at value zero on the domain axis.<a name="line.3921"></a>
- <span class="sourceLineNo">3922</span> *<a name="line.3922"></a>
- <span class="sourceLineNo">3923</span> * @param g2 the graphics device.<a name="line.3923"></a>
- <span class="sourceLineNo">3924</span> * @param area the data area.<a name="line.3924"></a>
- <span class="sourceLineNo">3925</span> *<a name="line.3925"></a>
- <span class="sourceLineNo">3926</span> * @see #setDomainZeroBaselineVisible(boolean)<a name="line.3926"></a>
- <span class="sourceLineNo">3927</span> *<a name="line.3927"></a>
- <span class="sourceLineNo">3928</span> * @since 1.0.5<a name="line.3928"></a>
- <span class="sourceLineNo">3929</span> */<a name="line.3929"></a>
- <span class="sourceLineNo">3930</span> protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) {<a name="line.3930"></a>
- <span class="sourceLineNo">3931</span> if (isDomainZeroBaselineVisible()) {<a name="line.3931"></a>
- <span class="sourceLineNo">3932</span> XYItemRenderer r = getRenderer();<a name="line.3932"></a>
- <span class="sourceLineNo">3933</span> // FIXME: the renderer interface doesn't have the drawDomainLine()<a name="line.3933"></a>
- <span class="sourceLineNo">3934</span> // method, so we have to rely on the renderer being a subclass of<a name="line.3934"></a>
- <span class="sourceLineNo">3935</span> // AbstractXYItemRenderer (which is lame)<a name="line.3935"></a>
- <span class="sourceLineNo">3936</span> if (r instanceof AbstractXYItemRenderer) {<a name="line.3936"></a>
- <span class="sourceLineNo">3937</span> AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r;<a name="line.3937"></a>
- <span class="sourceLineNo">3938</span> renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0,<a name="line.3938"></a>
- <span class="sourceLineNo">3939</span> this.domainZeroBaselinePaint,<a name="line.3939"></a>
- <span class="sourceLineNo">3940</span> this.domainZeroBaselineStroke);<a name="line.3940"></a>
- <span class="sourceLineNo">3941</span> }<a name="line.3941"></a>
- <span class="sourceLineNo">3942</span> }<a name="line.3942"></a>
- <span class="sourceLineNo">3943</span> }<a name="line.3943"></a>
- <span class="sourceLineNo">3944</span><a name="line.3944"></a>
- <span class="sourceLineNo">3945</span> /**<a name="line.3945"></a>
- <span class="sourceLineNo">3946</span> * Draws a base line across the chart at value zero on the range axis.<a name="line.3946"></a>
- <span class="sourceLineNo">3947</span> *<a name="line.3947"></a>
- <span class="sourceLineNo">3948</span> * @param g2 the graphics device.<a name="line.3948"></a>
- <span class="sourceLineNo">3949</span> * @param area the data area.<a name="line.3949"></a>
- <span class="sourceLineNo">3950</span> *<a name="line.3950"></a>
- <span class="sourceLineNo">3951</span> * @see #setRangeZeroBaselineVisible(boolean)<a name="line.3951"></a>
- <span class="sourceLineNo">3952</span> */<a name="line.3952"></a>
- <span class="sourceLineNo">3953</span> protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area) {<a name="line.3953"></a>
- <span class="sourceLineNo">3954</span> if (isRangeZeroBaselineVisible()) {<a name="line.3954"></a>
- <span class="sourceLineNo">3955</span> getRenderer().drawRangeLine(g2, this, getRangeAxis(), area, 0.0,<a name="line.3955"></a>
- <span class="sourceLineNo">3956</span> this.rangeZeroBaselinePaint, this.rangeZeroBaselineStroke);<a name="line.3956"></a>
- <span class="sourceLineNo">3957</span> }<a name="line.3957"></a>
- <span class="sourceLineNo">3958</span> }<a name="line.3958"></a>
- <span class="sourceLineNo">3959</span><a name="line.3959"></a>
- <span class="sourceLineNo">3960</span> /**<a name="line.3960"></a>
- <span class="sourceLineNo">3961</span> * Draws the annotations for the plot.<a name="line.3961"></a>
- <span class="sourceLineNo">3962</span> *<a name="line.3962"></a>
- <span class="sourceLineNo">3963</span> * @param g2 the graphics device.<a name="line.3963"></a>
- <span class="sourceLineNo">3964</span> * @param dataArea the data area.<a name="line.3964"></a>
- <span class="sourceLineNo">3965</span> * @param info the chart rendering info.<a name="line.3965"></a>
- <span class="sourceLineNo">3966</span> */<a name="line.3966"></a>
- <span class="sourceLineNo">3967</span> public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,<a name="line.3967"></a>
- <span class="sourceLineNo">3968</span> PlotRenderingInfo info) {<a name="line.3968"></a>
- <span class="sourceLineNo">3969</span><a name="line.3969"></a>
- <span class="sourceLineNo">3970</span> Iterator iterator = this.annotations.iterator();<a name="line.3970"></a>
- <span class="sourceLineNo">3971</span> while (iterator.hasNext()) {<a name="line.3971"></a>
- <span class="sourceLineNo">3972</span> XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.3972"></a>
- <span class="sourceLineNo">3973</span> ValueAxis xAxis = getDomainAxis();<a name="line.3973"></a>
- <span class="sourceLineNo">3974</span> ValueAxis yAxis = getRangeAxis();<a name="line.3974"></a>
- <span class="sourceLineNo">3975</span> annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);<a name="line.3975"></a>
- <span class="sourceLineNo">3976</span> }<a name="line.3976"></a>
- <span class="sourceLineNo">3977</span><a name="line.3977"></a>
- <span class="sourceLineNo">3978</span> }<a name="line.3978"></a>
- <span class="sourceLineNo">3979</span><a name="line.3979"></a>
- <span class="sourceLineNo">3980</span> /**<a name="line.3980"></a>
- <span class="sourceLineNo">3981</span> * Draws the domain markers (if any) for an axis and layer. This method is<a name="line.3981"></a>
- <span class="sourceLineNo">3982</span> * typically called from within the draw() method.<a name="line.3982"></a>
- <span class="sourceLineNo">3983</span> *<a name="line.3983"></a>
- <span class="sourceLineNo">3984</span> * @param g2 the graphics device.<a name="line.3984"></a>
- <span class="sourceLineNo">3985</span> * @param dataArea the data area.<a name="line.3985"></a>
- <span class="sourceLineNo">3986</span> * @param index the dataset/renderer index.<a name="line.3986"></a>
- <span class="sourceLineNo">3987</span> * @param layer the layer (foreground or background).<a name="line.3987"></a>
- <span class="sourceLineNo">3988</span> */<a name="line.3988"></a>
- <span class="sourceLineNo">3989</span> protected void drawDomainMarkers(Graphics2D g2, Rectangle2D dataArea,<a name="line.3989"></a>
- <span class="sourceLineNo">3990</span> int index, Layer layer) {<a name="line.3990"></a>
- <span class="sourceLineNo">3991</span><a name="line.3991"></a>
- <span class="sourceLineNo">3992</span> XYItemRenderer r = getRenderer(index);<a name="line.3992"></a>
- <span class="sourceLineNo">3993</span> if (r == null) {<a name="line.3993"></a>
- <span class="sourceLineNo">3994</span> return;<a name="line.3994"></a>
- <span class="sourceLineNo">3995</span> }<a name="line.3995"></a>
- <span class="sourceLineNo">3996</span> // check that the renderer has a corresponding dataset (it doesn't<a name="line.3996"></a>
- <span class="sourceLineNo">3997</span> // matter if the dataset is null)<a name="line.3997"></a>
- <span class="sourceLineNo">3998</span> if (index >= getDatasetCount()) {<a name="line.3998"></a>
- <span class="sourceLineNo">3999</span> return;<a name="line.3999"></a>
- <span class="sourceLineNo">4000</span> }<a name="line.4000"></a>
- <span class="sourceLineNo">4001</span> Collection markers = getDomainMarkers(index, layer);<a name="line.4001"></a>
- <span class="sourceLineNo">4002</span> ValueAxis axis = getDomainAxisForDataset(index);<a name="line.4002"></a>
- <span class="sourceLineNo">4003</span> if (markers != null && axis != null) {<a name="line.4003"></a>
- <span class="sourceLineNo">4004</span> Iterator iterator = markers.iterator();<a name="line.4004"></a>
- <span class="sourceLineNo">4005</span> while (iterator.hasNext()) {<a name="line.4005"></a>
- <span class="sourceLineNo">4006</span> Marker marker = (Marker) iterator.next();<a name="line.4006"></a>
- <span class="sourceLineNo">4007</span> r.drawDomainMarker(g2, this, axis, marker, dataArea);<a name="line.4007"></a>
- <span class="sourceLineNo">4008</span> }<a name="line.4008"></a>
- <span class="sourceLineNo">4009</span> }<a name="line.4009"></a>
- <span class="sourceLineNo">4010</span><a name="line.4010"></a>
- <span class="sourceLineNo">4011</span> }<a name="line.4011"></a>
- <span class="sourceLineNo">4012</span><a name="line.4012"></a>
- <span class="sourceLineNo">4013</span> /**<a name="line.4013"></a>
- <span class="sourceLineNo">4014</span> * Draws the range markers (if any) for a renderer and layer. This method<a name="line.4014"></a>
- <span class="sourceLineNo">4015</span> * is typically called from within the draw() method.<a name="line.4015"></a>
- <span class="sourceLineNo">4016</span> *<a name="line.4016"></a>
- <span class="sourceLineNo">4017</span> * @param g2 the graphics device.<a name="line.4017"></a>
- <span class="sourceLineNo">4018</span> * @param dataArea the data area.<a name="line.4018"></a>
- <span class="sourceLineNo">4019</span> * @param index the renderer index.<a name="line.4019"></a>
- <span class="sourceLineNo">4020</span> * @param layer the layer (foreground or background).<a name="line.4020"></a>
- <span class="sourceLineNo">4021</span> */<a name="line.4021"></a>
- <span class="sourceLineNo">4022</span> protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea,<a name="line.4022"></a>
- <span class="sourceLineNo">4023</span> int index, Layer layer) {<a name="line.4023"></a>
- <span class="sourceLineNo">4024</span><a name="line.4024"></a>
- <span class="sourceLineNo">4025</span> XYItemRenderer r = getRenderer(index);<a name="line.4025"></a>
- <span class="sourceLineNo">4026</span> if (r == null) {<a name="line.4026"></a>
- <span class="sourceLineNo">4027</span> return;<a name="line.4027"></a>
- <span class="sourceLineNo">4028</span> }<a name="line.4028"></a>
- <span class="sourceLineNo">4029</span> // check that the renderer has a corresponding dataset (it doesn't<a name="line.4029"></a>
- <span class="sourceLineNo">4030</span> // matter if the dataset is null)<a name="line.4030"></a>
- <span class="sourceLineNo">4031</span> if (index >= getDatasetCount()) {<a name="line.4031"></a>
- <span class="sourceLineNo">4032</span> return;<a name="line.4032"></a>
- <span class="sourceLineNo">4033</span> }<a name="line.4033"></a>
- <span class="sourceLineNo">4034</span> Collection markers = getRangeMarkers(index, layer);<a name="line.4034"></a>
- <span class="sourceLineNo">4035</span> ValueAxis axis = getRangeAxisForDataset(index);<a name="line.4035"></a>
- <span class="sourceLineNo">4036</span> if (markers != null && axis != null) {<a name="line.4036"></a>
- <span class="sourceLineNo">4037</span> Iterator iterator = markers.iterator();<a name="line.4037"></a>
- <span class="sourceLineNo">4038</span> while (iterator.hasNext()) {<a name="line.4038"></a>
- <span class="sourceLineNo">4039</span> Marker marker = (Marker) iterator.next();<a name="line.4039"></a>
- <span class="sourceLineNo">4040</span> r.drawRangeMarker(g2, this, axis, marker, dataArea);<a name="line.4040"></a>
- <span class="sourceLineNo">4041</span> }<a name="line.4041"></a>
- <span class="sourceLineNo">4042</span> }<a name="line.4042"></a>
- <span class="sourceLineNo">4043</span> }<a name="line.4043"></a>
- <span class="sourceLineNo">4044</span><a name="line.4044"></a>
- <span class="sourceLineNo">4045</span> /**<a name="line.4045"></a>
- <span class="sourceLineNo">4046</span> * Returns the list of domain markers (read only) for the specified layer.<a name="line.4046"></a>
- <span class="sourceLineNo">4047</span> *<a name="line.4047"></a>
- <span class="sourceLineNo">4048</span> * @param layer the layer (foreground or background).<a name="line.4048"></a>
- <span class="sourceLineNo">4049</span> *<a name="line.4049"></a>
- <span class="sourceLineNo">4050</span> * @return The list of domain markers.<a name="line.4050"></a>
- <span class="sourceLineNo">4051</span> *<a name="line.4051"></a>
- <span class="sourceLineNo">4052</span> * @see #getRangeMarkers(Layer)<a name="line.4052"></a>
- <span class="sourceLineNo">4053</span> */<a name="line.4053"></a>
- <span class="sourceLineNo">4054</span> public Collection getDomainMarkers(Layer layer) {<a name="line.4054"></a>
- <span class="sourceLineNo">4055</span> return getDomainMarkers(0, layer);<a name="line.4055"></a>
- <span class="sourceLineNo">4056</span> }<a name="line.4056"></a>
- <span class="sourceLineNo">4057</span><a name="line.4057"></a>
- <span class="sourceLineNo">4058</span> /**<a name="line.4058"></a>
- <span class="sourceLineNo">4059</span> * Returns the list of range markers (read only) for the specified layer.<a name="line.4059"></a>
- <span class="sourceLineNo">4060</span> *<a name="line.4060"></a>
- <span class="sourceLineNo">4061</span> * @param layer the layer (foreground or background).<a name="line.4061"></a>
- <span class="sourceLineNo">4062</span> *<a name="line.4062"></a>
- <span class="sourceLineNo">4063</span> * @return The list of range markers.<a name="line.4063"></a>
- <span class="sourceLineNo">4064</span> *<a name="line.4064"></a>
- <span class="sourceLineNo">4065</span> * @see #getDomainMarkers(Layer)<a name="line.4065"></a>
- <span class="sourceLineNo">4066</span> */<a name="line.4066"></a>
- <span class="sourceLineNo">4067</span> public Collection getRangeMarkers(Layer layer) {<a name="line.4067"></a>
- <span class="sourceLineNo">4068</span> return getRangeMarkers(0, layer);<a name="line.4068"></a>
- <span class="sourceLineNo">4069</span> }<a name="line.4069"></a>
- <span class="sourceLineNo">4070</span><a name="line.4070"></a>
- <span class="sourceLineNo">4071</span> /**<a name="line.4071"></a>
- <span class="sourceLineNo">4072</span> * Returns a collection of domain markers for a particular renderer and<a name="line.4072"></a>
- <span class="sourceLineNo">4073</span> * layer.<a name="line.4073"></a>
- <span class="sourceLineNo">4074</span> *<a name="line.4074"></a>
- <span class="sourceLineNo">4075</span> * @param index the renderer index.<a name="line.4075"></a>
- <span class="sourceLineNo">4076</span> * @param layer the layer.<a name="line.4076"></a>
- <span class="sourceLineNo">4077</span> *<a name="line.4077"></a>
- <span class="sourceLineNo">4078</span> * @return A collection of markers (possibly <code>null</code>).<a name="line.4078"></a>
- <span class="sourceLineNo">4079</span> *<a name="line.4079"></a>
- <span class="sourceLineNo">4080</span> * @see #getRangeMarkers(int, Layer)<a name="line.4080"></a>
- <span class="sourceLineNo">4081</span> */<a name="line.4081"></a>
- <span class="sourceLineNo">4082</span> public Collection getDomainMarkers(int index, Layer layer) {<a name="line.4082"></a>
- <span class="sourceLineNo">4083</span> Collection result = null;<a name="line.4083"></a>
- <span class="sourceLineNo">4084</span> Integer key = new Integer(index);<a name="line.4084"></a>
- <span class="sourceLineNo">4085</span> if (layer == Layer.FOREGROUND) {<a name="line.4085"></a>
- <span class="sourceLineNo">4086</span> result = (Collection) this.foregroundDomainMarkers.get(key);<a name="line.4086"></a>
- <span class="sourceLineNo">4087</span> }<a name="line.4087"></a>
- <span class="sourceLineNo">4088</span> else if (layer == Layer.BACKGROUND) {<a name="line.4088"></a>
- <span class="sourceLineNo">4089</span> result = (Collection) this.backgroundDomainMarkers.get(key);<a name="line.4089"></a>
- <span class="sourceLineNo">4090</span> }<a name="line.4090"></a>
- <span class="sourceLineNo">4091</span> if (result != null) {<a name="line.4091"></a>
- <span class="sourceLineNo">4092</span> result = Collections.unmodifiableCollection(result);<a name="line.4092"></a>
- <span class="sourceLineNo">4093</span> }<a name="line.4093"></a>
- <span class="sourceLineNo">4094</span> return result;<a name="line.4094"></a>
- <span class="sourceLineNo">4095</span> }<a name="line.4095"></a>
- <span class="sourceLineNo">4096</span><a name="line.4096"></a>
- <span class="sourceLineNo">4097</span> /**<a name="line.4097"></a>
- <span class="sourceLineNo">4098</span> * Returns a collection of range markers for a particular renderer and<a name="line.4098"></a>
- <span class="sourceLineNo">4099</span> * layer.<a name="line.4099"></a>
- <span class="sourceLineNo">4100</span> *<a name="line.4100"></a>
- <span class="sourceLineNo">4101</span> * @param index the renderer index.<a name="line.4101"></a>
- <span class="sourceLineNo">4102</span> * @param layer the layer.<a name="line.4102"></a>
- <span class="sourceLineNo">4103</span> *<a name="line.4103"></a>
- <span class="sourceLineNo">4104</span> * @return A collection of markers (possibly <code>null</code>).<a name="line.4104"></a>
- <span class="sourceLineNo">4105</span> *<a name="line.4105"></a>
- <span class="sourceLineNo">4106</span> * @see #getDomainMarkers(int, Layer)<a name="line.4106"></a>
- <span class="sourceLineNo">4107</span> */<a name="line.4107"></a>
- <span class="sourceLineNo">4108</span> public Collection getRangeMarkers(int index, Layer layer) {<a name="line.4108"></a>
- <span class="sourceLineNo">4109</span> Collection result = null;<a name="line.4109"></a>
- <span class="sourceLineNo">4110</span> Integer key = new Integer(index);<a name="line.4110"></a>
- <span class="sourceLineNo">4111</span> if (layer == Layer.FOREGROUND) {<a name="line.4111"></a>
- <span class="sourceLineNo">4112</span> result = (Collection) this.foregroundRangeMarkers.get(key);<a name="line.4112"></a>
- <span class="sourceLineNo">4113</span> }<a name="line.4113"></a>
- <span class="sourceLineNo">4114</span> else if (layer == Layer.BACKGROUND) {<a name="line.4114"></a>
- <span class="sourceLineNo">4115</span> result = (Collection) this.backgroundRangeMarkers.get(key);<a name="line.4115"></a>
- <span class="sourceLineNo">4116</span> }<a name="line.4116"></a>
- <span class="sourceLineNo">4117</span> if (result != null) {<a name="line.4117"></a>
- <span class="sourceLineNo">4118</span> result = Collections.unmodifiableCollection(result);<a name="line.4118"></a>
- <span class="sourceLineNo">4119</span> }<a name="line.4119"></a>
- <span class="sourceLineNo">4120</span> return result;<a name="line.4120"></a>
- <span class="sourceLineNo">4121</span> }<a name="line.4121"></a>
- <span class="sourceLineNo">4122</span><a name="line.4122"></a>
- <span class="sourceLineNo">4123</span> /**<a name="line.4123"></a>
- <span class="sourceLineNo">4124</span> * Utility method for drawing a horizontal line across the data area of the<a name="line.4124"></a>
- <span class="sourceLineNo">4125</span> * plot.<a name="line.4125"></a>
- <span class="sourceLineNo">4126</span> *<a name="line.4126"></a>
- <span class="sourceLineNo">4127</span> * @param g2 the graphics device.<a name="line.4127"></a>
- <span class="sourceLineNo">4128</span> * @param dataArea the data area.<a name="line.4128"></a>
- <span class="sourceLineNo">4129</span> * @param value the coordinate, where to draw the line.<a name="line.4129"></a>
- <span class="sourceLineNo">4130</span> * @param stroke the stroke to use.<a name="line.4130"></a>
- <span class="sourceLineNo">4131</span> * @param paint the paint to use.<a name="line.4131"></a>
- <span class="sourceLineNo">4132</span> */<a name="line.4132"></a>
- <span class="sourceLineNo">4133</span> protected void drawHorizontalLine(Graphics2D g2, Rectangle2D dataArea,<a name="line.4133"></a>
- <span class="sourceLineNo">4134</span> double value, Stroke stroke,<a name="line.4134"></a>
- <span class="sourceLineNo">4135</span> Paint paint) {<a name="line.4135"></a>
- <span class="sourceLineNo">4136</span><a name="line.4136"></a>
- <span class="sourceLineNo">4137</span> ValueAxis axis = getRangeAxis();<a name="line.4137"></a>
- <span class="sourceLineNo">4138</span> if (getOrientation() == PlotOrientation.HORIZONTAL) {<a name="line.4138"></a>
- <span class="sourceLineNo">4139</span> axis = getDomainAxis();<a name="line.4139"></a>
- <span class="sourceLineNo">4140</span> }<a name="line.4140"></a>
- <span class="sourceLineNo">4141</span> if (axis.getRange().contains(value)) {<a name="line.4141"></a>
- <span class="sourceLineNo">4142</span> double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);<a name="line.4142"></a>
- <span class="sourceLineNo">4143</span> Line2D line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4143"></a>
- <span class="sourceLineNo">4144</span> dataArea.getMaxX(), yy);<a name="line.4144"></a>
- <span class="sourceLineNo">4145</span> g2.setStroke(stroke);<a name="line.4145"></a>
- <span class="sourceLineNo">4146</span> g2.setPaint(paint);<a name="line.4146"></a>
- <span class="sourceLineNo">4147</span> g2.draw(line);<a name="line.4147"></a>
- <span class="sourceLineNo">4148</span> }<a name="line.4148"></a>
- <span class="sourceLineNo">4149</span><a name="line.4149"></a>
- <span class="sourceLineNo">4150</span> }<a name="line.4150"></a>
- <span class="sourceLineNo">4151</span><a name="line.4151"></a>
- <span class="sourceLineNo">4152</span> /**<a name="line.4152"></a>
- <span class="sourceLineNo">4153</span> * Draws a domain crosshair.<a name="line.4153"></a>
- <span class="sourceLineNo">4154</span> *<a name="line.4154"></a>
- <span class="sourceLineNo">4155</span> * @param g2 the graphics target.<a name="line.4155"></a>
- <span class="sourceLineNo">4156</span> * @param dataArea the data area.<a name="line.4156"></a>
- <span class="sourceLineNo">4157</span> * @param orientation the plot orientation.<a name="line.4157"></a>
- <span class="sourceLineNo">4158</span> * @param value the crosshair value.<a name="line.4158"></a>
- <span class="sourceLineNo">4159</span> * @param axis the axis against which the value is measured.<a name="line.4159"></a>
- <span class="sourceLineNo">4160</span> * @param stroke the stroke used to draw the crosshair line.<a name="line.4160"></a>
- <span class="sourceLineNo">4161</span> * @param paint the paint used to draw the crosshair line.<a name="line.4161"></a>
- <span class="sourceLineNo">4162</span> *<a name="line.4162"></a>
- <span class="sourceLineNo">4163</span> * @since 1.0.4<a name="line.4163"></a>
- <span class="sourceLineNo">4164</span> */<a name="line.4164"></a>
- <span class="sourceLineNo">4165</span> protected void drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea,<a name="line.4165"></a>
- <span class="sourceLineNo">4166</span> PlotOrientation orientation, double value, ValueAxis axis,<a name="line.4166"></a>
- <span class="sourceLineNo">4167</span> Stroke stroke, Paint paint) {<a name="line.4167"></a>
- <span class="sourceLineNo">4168</span><a name="line.4168"></a>
- <span class="sourceLineNo">4169</span> if (!axis.getRange().contains(value)) {<a name="line.4169"></a>
- <span class="sourceLineNo">4170</span> return;<a name="line.4170"></a>
- <span class="sourceLineNo">4171</span> }<a name="line.4171"></a>
- <span class="sourceLineNo">4172</span> Line2D line;<a name="line.4172"></a>
- <span class="sourceLineNo">4173</span> if (orientation == PlotOrientation.VERTICAL) {<a name="line.4173"></a>
- <span class="sourceLineNo">4174</span> double xx = axis.valueToJava2D(value, dataArea,<a name="line.4174"></a>
- <span class="sourceLineNo">4175</span> RectangleEdge.BOTTOM);<a name="line.4175"></a>
- <span class="sourceLineNo">4176</span> line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4176"></a>
- <span class="sourceLineNo">4177</span> dataArea.getMaxY());<a name="line.4177"></a>
- <span class="sourceLineNo">4178</span> } else {<a name="line.4178"></a>
- <span class="sourceLineNo">4179</span> double yy = axis.valueToJava2D(value, dataArea,<a name="line.4179"></a>
- <span class="sourceLineNo">4180</span> RectangleEdge.LEFT);<a name="line.4180"></a>
- <span class="sourceLineNo">4181</span> line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4181"></a>
- <span class="sourceLineNo">4182</span> dataArea.getMaxX(), yy);<a name="line.4182"></a>
- <span class="sourceLineNo">4183</span> }<a name="line.4183"></a>
- <span class="sourceLineNo">4184</span> Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);<a name="line.4184"></a>
- <span class="sourceLineNo">4185</span> g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, <a name="line.4185"></a>
- <span class="sourceLineNo">4186</span> RenderingHints.VALUE_STROKE_NORMALIZE);<a name="line.4186"></a>
- <span class="sourceLineNo">4187</span> g2.setStroke(stroke);<a name="line.4187"></a>
- <span class="sourceLineNo">4188</span> g2.setPaint(paint);<a name="line.4188"></a>
- <span class="sourceLineNo">4189</span> g2.draw(line);<a name="line.4189"></a>
- <span class="sourceLineNo">4190</span> g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved);<a name="line.4190"></a>
- <span class="sourceLineNo">4191</span> }<a name="line.4191"></a>
- <span class="sourceLineNo">4192</span><a name="line.4192"></a>
- <span class="sourceLineNo">4193</span> /**<a name="line.4193"></a>
- <span class="sourceLineNo">4194</span> * Utility method for drawing a vertical line on the data area of the plot.<a name="line.4194"></a>
- <span class="sourceLineNo">4195</span> *<a name="line.4195"></a>
- <span class="sourceLineNo">4196</span> * @param g2 the graphics device.<a name="line.4196"></a>
- <span class="sourceLineNo">4197</span> * @param dataArea the data area.<a name="line.4197"></a>
- <span class="sourceLineNo">4198</span> * @param value the coordinate, where to draw the line.<a name="line.4198"></a>
- <span class="sourceLineNo">4199</span> * @param stroke the stroke to use.<a name="line.4199"></a>
- <span class="sourceLineNo">4200</span> * @param paint the paint to use.<a name="line.4200"></a>
- <span class="sourceLineNo">4201</span> */<a name="line.4201"></a>
- <span class="sourceLineNo">4202</span> protected void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea,<a name="line.4202"></a>
- <span class="sourceLineNo">4203</span> double value, Stroke stroke, Paint paint) {<a name="line.4203"></a>
- <span class="sourceLineNo">4204</span><a name="line.4204"></a>
- <span class="sourceLineNo">4205</span> ValueAxis axis = getDomainAxis();<a name="line.4205"></a>
- <span class="sourceLineNo">4206</span> if (getOrientation() == PlotOrientation.HORIZONTAL) {<a name="line.4206"></a>
- <span class="sourceLineNo">4207</span> axis = getRangeAxis();<a name="line.4207"></a>
- <span class="sourceLineNo">4208</span> }<a name="line.4208"></a>
- <span class="sourceLineNo">4209</span> if (axis.getRange().contains(value)) {<a name="line.4209"></a>
- <span class="sourceLineNo">4210</span> double xx = axis.valueToJava2D(value, dataArea,<a name="line.4210"></a>
- <span class="sourceLineNo">4211</span> RectangleEdge.BOTTOM);<a name="line.4211"></a>
- <span class="sourceLineNo">4212</span> Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4212"></a>
- <span class="sourceLineNo">4213</span> dataArea.getMaxY());<a name="line.4213"></a>
- <span class="sourceLineNo">4214</span> g2.setStroke(stroke);<a name="line.4214"></a>
- <span class="sourceLineNo">4215</span> g2.setPaint(paint);<a name="line.4215"></a>
- <span class="sourceLineNo">4216</span> g2.draw(line);<a name="line.4216"></a>
- <span class="sourceLineNo">4217</span> }<a name="line.4217"></a>
- <span class="sourceLineNo">4218</span><a name="line.4218"></a>
- <span class="sourceLineNo">4219</span> }<a name="line.4219"></a>
- <span class="sourceLineNo">4220</span><a name="line.4220"></a>
- <span class="sourceLineNo">4221</span> /**<a name="line.4221"></a>
- <span class="sourceLineNo">4222</span> * Draws a range crosshair.<a name="line.4222"></a>
- <span class="sourceLineNo">4223</span> *<a name="line.4223"></a>
- <span class="sourceLineNo">4224</span> * @param g2 the graphics target.<a name="line.4224"></a>
- <span class="sourceLineNo">4225</span> * @param dataArea the data area.<a name="line.4225"></a>
- <span class="sourceLineNo">4226</span> * @param orientation the plot orientation.<a name="line.4226"></a>
- <span class="sourceLineNo">4227</span> * @param value the crosshair value.<a name="line.4227"></a>
- <span class="sourceLineNo">4228</span> * @param axis the axis against which the value is measured.<a name="line.4228"></a>
- <span class="sourceLineNo">4229</span> * @param stroke the stroke used to draw the crosshair line.<a name="line.4229"></a>
- <span class="sourceLineNo">4230</span> * @param paint the paint used to draw the crosshair line.<a name="line.4230"></a>
- <span class="sourceLineNo">4231</span> *<a name="line.4231"></a>
- <span class="sourceLineNo">4232</span> * @since 1.0.4<a name="line.4232"></a>
- <span class="sourceLineNo">4233</span> */<a name="line.4233"></a>
- <span class="sourceLineNo">4234</span> protected void drawRangeCrosshair(Graphics2D g2, Rectangle2D dataArea,<a name="line.4234"></a>
- <span class="sourceLineNo">4235</span> PlotOrientation orientation, double value, ValueAxis axis,<a name="line.4235"></a>
- <span class="sourceLineNo">4236</span> Stroke stroke, Paint paint) {<a name="line.4236"></a>
- <span class="sourceLineNo">4237</span><a name="line.4237"></a>
- <span class="sourceLineNo">4238</span> if (!axis.getRange().contains(value)) {<a name="line.4238"></a>
- <span class="sourceLineNo">4239</span> return;<a name="line.4239"></a>
- <span class="sourceLineNo">4240</span> }<a name="line.4240"></a>
- <span class="sourceLineNo">4241</span> Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);<a name="line.4241"></a>
- <span class="sourceLineNo">4242</span> g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, <a name="line.4242"></a>
- <span class="sourceLineNo">4243</span> RenderingHints.VALUE_STROKE_NORMALIZE);<a name="line.4243"></a>
- <span class="sourceLineNo">4244</span> Line2D line;<a name="line.4244"></a>
- <span class="sourceLineNo">4245</span> if (orientation == PlotOrientation.HORIZONTAL) {<a name="line.4245"></a>
- <span class="sourceLineNo">4246</span> double xx = axis.valueToJava2D(value, dataArea, <a name="line.4246"></a>
- <span class="sourceLineNo">4247</span> RectangleEdge.BOTTOM);<a name="line.4247"></a>
- <span class="sourceLineNo">4248</span> line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4248"></a>
- <span class="sourceLineNo">4249</span> dataArea.getMaxY());<a name="line.4249"></a>
- <span class="sourceLineNo">4250</span> } else {<a name="line.4250"></a>
- <span class="sourceLineNo">4251</span> double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);<a name="line.4251"></a>
- <span class="sourceLineNo">4252</span> line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4252"></a>
- <span class="sourceLineNo">4253</span> dataArea.getMaxX(), yy);<a name="line.4253"></a>
- <span class="sourceLineNo">4254</span> }<a name="line.4254"></a>
- <span class="sourceLineNo">4255</span> g2.setStroke(stroke);<a name="line.4255"></a>
- <span class="sourceLineNo">4256</span> g2.setPaint(paint);<a name="line.4256"></a>
- <span class="sourceLineNo">4257</span> g2.draw(line);<a name="line.4257"></a>
- <span class="sourceLineNo">4258</span> g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved);<a name="line.4258"></a>
- <span class="sourceLineNo">4259</span> }<a name="line.4259"></a>
- <span class="sourceLineNo">4260</span><a name="line.4260"></a>
- <span class="sourceLineNo">4261</span> /**<a name="line.4261"></a>
- <span class="sourceLineNo">4262</span> * Handles a 'click' on the plot by updating the anchor values.<a name="line.4262"></a>
- <span class="sourceLineNo">4263</span> *<a name="line.4263"></a>
- <span class="sourceLineNo">4264</span> * @param x the x-coordinate, where the click occurred, in Java2D space.<a name="line.4264"></a>
- <span class="sourceLineNo">4265</span> * @param y the y-coordinate, where the click occurred, in Java2D space.<a name="line.4265"></a>
- <span class="sourceLineNo">4266</span> * @param info object containing information about the plot dimensions.<a name="line.4266"></a>
- <span class="sourceLineNo">4267</span> */<a name="line.4267"></a>
- <span class="sourceLineNo">4268</span> @Override<a name="line.4268"></a>
- <span class="sourceLineNo">4269</span> public void handleClick(int x, int y, PlotRenderingInfo info) {<a name="line.4269"></a>
- <span class="sourceLineNo">4270</span><a name="line.4270"></a>
- <span class="sourceLineNo">4271</span> Rectangle2D dataArea = info.getDataArea();<a name="line.4271"></a>
- <span class="sourceLineNo">4272</span> if (dataArea.contains(x, y)) {<a name="line.4272"></a>
- <span class="sourceLineNo">4273</span> // set the anchor value for the horizontal axis...<a name="line.4273"></a>
- <span class="sourceLineNo">4274</span> ValueAxis xaxis = getDomainAxis();<a name="line.4274"></a>
- <span class="sourceLineNo">4275</span> if (xaxis != null) {<a name="line.4275"></a>
- <span class="sourceLineNo">4276</span> double hvalue = xaxis.java2DToValue(x, info.getDataArea(),<a name="line.4276"></a>
- <span class="sourceLineNo">4277</span> getDomainAxisEdge());<a name="line.4277"></a>
- <span class="sourceLineNo">4278</span> setDomainCrosshairValue(hvalue);<a name="line.4278"></a>
- <span class="sourceLineNo">4279</span> }<a name="line.4279"></a>
- <span class="sourceLineNo">4280</span><a name="line.4280"></a>
- <span class="sourceLineNo">4281</span> // set the anchor value for the vertical axis...<a name="line.4281"></a>
- <span class="sourceLineNo">4282</span> ValueAxis yaxis = getRangeAxis();<a name="line.4282"></a>
- <span class="sourceLineNo">4283</span> if (yaxis != null) {<a name="line.4283"></a>
- <span class="sourceLineNo">4284</span> double vvalue = yaxis.java2DToValue(y, info.getDataArea(),<a name="line.4284"></a>
- <span class="sourceLineNo">4285</span> getRangeAxisEdge());<a name="line.4285"></a>
- <span class="sourceLineNo">4286</span> setRangeCrosshairValue(vvalue);<a name="line.4286"></a>
- <span class="sourceLineNo">4287</span> }<a name="line.4287"></a>
- <span class="sourceLineNo">4288</span> }<a name="line.4288"></a>
- <span class="sourceLineNo">4289</span> }<a name="line.4289"></a>
- <span class="sourceLineNo">4290</span><a name="line.4290"></a>
- <span class="sourceLineNo">4291</span> /**<a name="line.4291"></a>
- <span class="sourceLineNo">4292</span> * A utility method that returns a list of datasets that are mapped to a<a name="line.4292"></a>
- <span class="sourceLineNo">4293</span> * particular axis.<a name="line.4293"></a>
- <span class="sourceLineNo">4294</span> *<a name="line.4294"></a>
- <span class="sourceLineNo">4295</span> * @param axisIndex the axis index (<code>null</code> not permitted).<a name="line.4295"></a>
- <span class="sourceLineNo">4296</span> *<a name="line.4296"></a>
- <span class="sourceLineNo">4297</span> * @return A list of datasets.<a name="line.4297"></a>
- <span class="sourceLineNo">4298</span> */<a name="line.4298"></a>
- <span class="sourceLineNo">4299</span> private List<XYDataset> getDatasetsMappedToDomainAxis(Integer axisIndex) {<a name="line.4299"></a>
- <span class="sourceLineNo">4300</span> ParamChecks.nullNotPermitted(axisIndex, "axisIndex");<a name="line.4300"></a>
- <span class="sourceLineNo">4301</span> List<XYDataset> result = new ArrayList<XYDataset>();<a name="line.4301"></a>
- <span class="sourceLineNo">4302</span> for (Entry<Integer, XYDataset> entry : this.datasets.entrySet()) {<a name="line.4302"></a>
- <span class="sourceLineNo">4303</span> int index = entry.getKey();<a name="line.4303"></a>
- <span class="sourceLineNo">4304</span> List<Integer> mappedAxes = this.datasetToDomainAxesMap.get(index);<a name="line.4304"></a>
- <span class="sourceLineNo">4305</span> if (mappedAxes == null) {<a name="line.4305"></a>
- <span class="sourceLineNo">4306</span> if (axisIndex.equals(ZERO)) {<a name="line.4306"></a>
- <span class="sourceLineNo">4307</span> result.add(entry.getValue());<a name="line.4307"></a>
- <span class="sourceLineNo">4308</span> }<a name="line.4308"></a>
- <span class="sourceLineNo">4309</span> } else {<a name="line.4309"></a>
- <span class="sourceLineNo">4310</span> if (mappedAxes.contains(axisIndex)) {<a name="line.4310"></a>
- <span class="sourceLineNo">4311</span> result.add(entry.getValue());<a name="line.4311"></a>
- <span class="sourceLineNo">4312</span> }<a name="line.4312"></a>
- <span class="sourceLineNo">4313</span> }<a name="line.4313"></a>
- <span class="sourceLineNo">4314</span> }<a name="line.4314"></a>
- <span class="sourceLineNo">4315</span> return result;<a name="line.4315"></a>
- <span class="sourceLineNo">4316</span> }<a name="line.4316"></a>
- <span class="sourceLineNo">4317</span><a name="line.4317"></a>
- <span class="sourceLineNo">4318</span> /**<a name="line.4318"></a>
- <span class="sourceLineNo">4319</span> * A utility method that returns a list of datasets that are mapped to a<a name="line.4319"></a>
- <span class="sourceLineNo">4320</span> * particular axis.<a name="line.4320"></a>
- <span class="sourceLineNo">4321</span> *<a name="line.4321"></a>
- <span class="sourceLineNo">4322</span> * @param axisIndex the axis index (<code>null</code> not permitted).<a name="line.4322"></a>
- <span class="sourceLineNo">4323</span> *<a name="line.4323"></a>
- <span class="sourceLineNo">4324</span> * @return A list of datasets.<a name="line.4324"></a>
- <span class="sourceLineNo">4325</span> */<a name="line.4325"></a>
- <span class="sourceLineNo">4326</span> private List<XYDataset> getDatasetsMappedToRangeAxis(Integer axisIndex) {<a name="line.4326"></a>
- <span class="sourceLineNo">4327</span> ParamChecks.nullNotPermitted(axisIndex, "axisIndex");<a name="line.4327"></a>
- <span class="sourceLineNo">4328</span> List<XYDataset> result = new ArrayList<XYDataset>();<a name="line.4328"></a>
- <span class="sourceLineNo">4329</span> for (Entry<Integer, XYDataset> entry : this.datasets.entrySet()) {<a name="line.4329"></a>
- <span class="sourceLineNo">4330</span> int index = entry.getKey();<a name="line.4330"></a>
- <span class="sourceLineNo">4331</span> List<Integer> mappedAxes = this.datasetToRangeAxesMap.get(index);<a name="line.4331"></a>
- <span class="sourceLineNo">4332</span> if (mappedAxes == null) {<a name="line.4332"></a>
- <span class="sourceLineNo">4333</span> if (axisIndex.equals(ZERO)) {<a name="line.4333"></a>
- <span class="sourceLineNo">4334</span> result.add(entry.getValue());<a name="line.4334"></a>
- <span class="sourceLineNo">4335</span> }<a name="line.4335"></a>
- <span class="sourceLineNo">4336</span> } else {<a name="line.4336"></a>
- <span class="sourceLineNo">4337</span> if (mappedAxes.contains(axisIndex)) {<a name="line.4337"></a>
- <span class="sourceLineNo">4338</span> result.add(entry.getValue());<a name="line.4338"></a>
- <span class="sourceLineNo">4339</span> }<a name="line.4339"></a>
- <span class="sourceLineNo">4340</span> }<a name="line.4340"></a>
- <span class="sourceLineNo">4341</span> }<a name="line.4341"></a>
- <span class="sourceLineNo">4342</span> return result;<a name="line.4342"></a>
- <span class="sourceLineNo">4343</span> }<a name="line.4343"></a>
- <span class="sourceLineNo">4344</span><a name="line.4344"></a>
- <span class="sourceLineNo">4345</span> /**<a name="line.4345"></a>
- <span class="sourceLineNo">4346</span> * Returns the index of the given domain axis.<a name="line.4346"></a>
- <span class="sourceLineNo">4347</span> *<a name="line.4347"></a>
- <span class="sourceLineNo">4348</span> * @param axis the axis.<a name="line.4348"></a>
- <span class="sourceLineNo">4349</span> *<a name="line.4349"></a>
- <span class="sourceLineNo">4350</span> * @return The axis index.<a name="line.4350"></a>
- <span class="sourceLineNo">4351</span> *<a name="line.4351"></a>
- <span class="sourceLineNo">4352</span> * @see #getRangeAxisIndex(ValueAxis)<a name="line.4352"></a>
- <span class="sourceLineNo">4353</span> */<a name="line.4353"></a>
- <span class="sourceLineNo">4354</span> public int getDomainAxisIndex(ValueAxis axis) {<a name="line.4354"></a>
- <span class="sourceLineNo">4355</span> int result = findDomainAxisIndex(axis);<a name="line.4355"></a>
- <span class="sourceLineNo">4356</span> if (result < 0) {<a name="line.4356"></a>
- <span class="sourceLineNo">4357</span> // try the parent plot<a name="line.4357"></a>
- <span class="sourceLineNo">4358</span> Plot parent = getParent();<a name="line.4358"></a>
- <span class="sourceLineNo">4359</span> if (parent instanceof XYPlot) {<a name="line.4359"></a>
- <span class="sourceLineNo">4360</span> XYPlot p = (XYPlot) parent;<a name="line.4360"></a>
- <span class="sourceLineNo">4361</span> result = p.getDomainAxisIndex(axis);<a name="line.4361"></a>
- <span class="sourceLineNo">4362</span> }<a name="line.4362"></a>
- <span class="sourceLineNo">4363</span> }<a name="line.4363"></a>
- <span class="sourceLineNo">4364</span> return result;<a name="line.4364"></a>
- <span class="sourceLineNo">4365</span> }<a name="line.4365"></a>
- <span class="sourceLineNo">4366</span> <a name="line.4366"></a>
- <span class="sourceLineNo">4367</span> private int findDomainAxisIndex(ValueAxis axis) {<a name="line.4367"></a>
- <span class="sourceLineNo">4368</span> for (Map.Entry<Integer, ValueAxis> entry : this.domainAxes.entrySet()) {<a name="line.4368"></a>
- <span class="sourceLineNo">4369</span> if (entry.getValue() == axis) {<a name="line.4369"></a>
- <span class="sourceLineNo">4370</span> return entry.getKey();<a name="line.4370"></a>
- <span class="sourceLineNo">4371</span> }<a name="line.4371"></a>
- <span class="sourceLineNo">4372</span> }<a name="line.4372"></a>
- <span class="sourceLineNo">4373</span> return -1;<a name="line.4373"></a>
- <span class="sourceLineNo">4374</span> }<a name="line.4374"></a>
- <span class="sourceLineNo">4375</span><a name="line.4375"></a>
- <span class="sourceLineNo">4376</span> /**<a name="line.4376"></a>
- <span class="sourceLineNo">4377</span> * Returns the index of the given range axis.<a name="line.4377"></a>
- <span class="sourceLineNo">4378</span> *<a name="line.4378"></a>
- <span class="sourceLineNo">4379</span> * @param axis the axis.<a name="line.4379"></a>
- <span class="sourceLineNo">4380</span> *<a name="line.4380"></a>
- <span class="sourceLineNo">4381</span> * @return The axis index.<a name="line.4381"></a>
- <span class="sourceLineNo">4382</span> *<a name="line.4382"></a>
- <span class="sourceLineNo">4383</span> * @see #getDomainAxisIndex(ValueAxis)<a name="line.4383"></a>
- <span class="sourceLineNo">4384</span> */<a name="line.4384"></a>
- <span class="sourceLineNo">4385</span> public int getRangeAxisIndex(ValueAxis axis) {<a name="line.4385"></a>
- <span class="sourceLineNo">4386</span> int result = findRangeAxisIndex(axis);<a name="line.4386"></a>
- <span class="sourceLineNo">4387</span> if (result < 0) {<a name="line.4387"></a>
- <span class="sourceLineNo">4388</span> // try the parent plot<a name="line.4388"></a>
- <span class="sourceLineNo">4389</span> Plot parent = getParent();<a name="line.4389"></a>
- <span class="sourceLineNo">4390</span> if (parent instanceof XYPlot) {<a name="line.4390"></a>
- <span class="sourceLineNo">4391</span> XYPlot p = (XYPlot) parent;<a name="line.4391"></a>
- <span class="sourceLineNo">4392</span> result = p.getRangeAxisIndex(axis);<a name="line.4392"></a>
- <span class="sourceLineNo">4393</span> }<a name="line.4393"></a>
- <span class="sourceLineNo">4394</span> }<a name="line.4394"></a>
- <span class="sourceLineNo">4395</span> return result;<a name="line.4395"></a>
- <span class="sourceLineNo">4396</span> }<a name="line.4396"></a>
- <span class="sourceLineNo">4397</span><a name="line.4397"></a>
- <span class="sourceLineNo">4398</span> private int findRangeAxisIndex(ValueAxis axis) {<a name="line.4398"></a>
- <span class="sourceLineNo">4399</span> for (Map.Entry<Integer, ValueAxis> entry : this.rangeAxes.entrySet()) {<a name="line.4399"></a>
- <span class="sourceLineNo">4400</span> if (entry.getValue() == axis) {<a name="line.4400"></a>
- <span class="sourceLineNo">4401</span> return entry.getKey();<a name="line.4401"></a>
- <span class="sourceLineNo">4402</span> }<a name="line.4402"></a>
- <span class="sourceLineNo">4403</span> }<a name="line.4403"></a>
- <span class="sourceLineNo">4404</span> return -1;<a name="line.4404"></a>
- <span class="sourceLineNo">4405</span> }<a name="line.4405"></a>
- <span class="sourceLineNo">4406</span><a name="line.4406"></a>
- <span class="sourceLineNo">4407</span> /**<a name="line.4407"></a>
- <span class="sourceLineNo">4408</span> * Returns the range for the specified axis.<a name="line.4408"></a>
- <span class="sourceLineNo">4409</span> *<a name="line.4409"></a>
- <span class="sourceLineNo">4410</span> * @param axis the axis.<a name="line.4410"></a>
- <span class="sourceLineNo">4411</span> *<a name="line.4411"></a>
- <span class="sourceLineNo">4412</span> * @return The range.<a name="line.4412"></a>
- <span class="sourceLineNo">4413</span> */<a name="line.4413"></a>
- <span class="sourceLineNo">4414</span> @Override<a name="line.4414"></a>
- <span class="sourceLineNo">4415</span> public Range getDataRange(ValueAxis axis) {<a name="line.4415"></a>
- <span class="sourceLineNo">4416</span><a name="line.4416"></a>
- <span class="sourceLineNo">4417</span> Range result = null;<a name="line.4417"></a>
- <span class="sourceLineNo">4418</span> List<XYDataset> mappedDatasets = new ArrayList<XYDataset>();<a name="line.4418"></a>
- <span class="sourceLineNo">4419</span> List<XYAnnotation> includedAnnotations = new ArrayList<XYAnnotation>();<a name="line.4419"></a>
- <span class="sourceLineNo">4420</span> boolean isDomainAxis = true;<a name="line.4420"></a>
- <span class="sourceLineNo">4421</span><a name="line.4421"></a>
- <span class="sourceLineNo">4422</span> // is it a domain axis?<a name="line.4422"></a>
- <span class="sourceLineNo">4423</span> int domainIndex = getDomainAxisIndex(axis);<a name="line.4423"></a>
- <span class="sourceLineNo">4424</span> if (domainIndex >= 0) {<a name="line.4424"></a>
- <span class="sourceLineNo">4425</span> isDomainAxis = true;<a name="line.4425"></a>
- <span class="sourceLineNo">4426</span> mappedDatasets.addAll(getDatasetsMappedToDomainAxis(domainIndex));<a name="line.4426"></a>
- <span class="sourceLineNo">4427</span> if (domainIndex == 0) {<a name="line.4427"></a>
- <span class="sourceLineNo">4428</span> // grab the plot's annotations<a name="line.4428"></a>
- <span class="sourceLineNo">4429</span> Iterator iterator = this.annotations.iterator();<a name="line.4429"></a>
- <span class="sourceLineNo">4430</span> while (iterator.hasNext()) {<a name="line.4430"></a>
- <span class="sourceLineNo">4431</span> XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.4431"></a>
- <span class="sourceLineNo">4432</span> if (annotation instanceof XYAnnotationBoundsInfo) {<a name="line.4432"></a>
- <span class="sourceLineNo">4433</span> includedAnnotations.add(annotation);<a name="line.4433"></a>
- <span class="sourceLineNo">4434</span> }<a name="line.4434"></a>
- <span class="sourceLineNo">4435</span> }<a name="line.4435"></a>
- <span class="sourceLineNo">4436</span> }<a name="line.4436"></a>
- <span class="sourceLineNo">4437</span> }<a name="line.4437"></a>
- <span class="sourceLineNo">4438</span><a name="line.4438"></a>
- <span class="sourceLineNo">4439</span> // or is it a range axis?<a name="line.4439"></a>
- <span class="sourceLineNo">4440</span> int rangeIndex = getRangeAxisIndex(axis);<a name="line.4440"></a>
- <span class="sourceLineNo">4441</span> if (rangeIndex >= 0) {<a name="line.4441"></a>
- <span class="sourceLineNo">4442</span> isDomainAxis = false;<a name="line.4442"></a>
- <span class="sourceLineNo">4443</span> mappedDatasets.addAll(getDatasetsMappedToRangeAxis(rangeIndex));<a name="line.4443"></a>
- <span class="sourceLineNo">4444</span> if (rangeIndex == 0) {<a name="line.4444"></a>
- <span class="sourceLineNo">4445</span> Iterator iterator = this.annotations.iterator();<a name="line.4445"></a>
- <span class="sourceLineNo">4446</span> while (iterator.hasNext()) {<a name="line.4446"></a>
- <span class="sourceLineNo">4447</span> XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.4447"></a>
- <span class="sourceLineNo">4448</span> if (annotation instanceof XYAnnotationBoundsInfo) {<a name="line.4448"></a>
- <span class="sourceLineNo">4449</span> includedAnnotations.add(annotation);<a name="line.4449"></a>
- <span class="sourceLineNo">4450</span> }<a name="line.4450"></a>
- <span class="sourceLineNo">4451</span> }<a name="line.4451"></a>
- <span class="sourceLineNo">4452</span> }<a name="line.4452"></a>
- <span class="sourceLineNo">4453</span> }<a name="line.4453"></a>
- <span class="sourceLineNo">4454</span><a name="line.4454"></a>
- <span class="sourceLineNo">4455</span> // iterate through the datasets that map to the axis and get the union<a name="line.4455"></a>
- <span class="sourceLineNo">4456</span> // of the ranges.<a name="line.4456"></a>
- <span class="sourceLineNo">4457</span> for (XYDataset d : mappedDatasets) {<a name="line.4457"></a>
- <span class="sourceLineNo">4458</span> if (d != null) {<a name="line.4458"></a>
- <span class="sourceLineNo">4459</span> XYItemRenderer r = getRendererForDataset(d);<a name="line.4459"></a>
- <span class="sourceLineNo">4460</span> if (isDomainAxis) {<a name="line.4460"></a>
- <span class="sourceLineNo">4461</span> if (r != null) {<a name="line.4461"></a>
- <span class="sourceLineNo">4462</span> result = Range.combine(result, r.findDomainBounds(d));<a name="line.4462"></a>
- <span class="sourceLineNo">4463</span> }<a name="line.4463"></a>
- <span class="sourceLineNo">4464</span> else {<a name="line.4464"></a>
- <span class="sourceLineNo">4465</span> result = Range.combine(result,<a name="line.4465"></a>
- <span class="sourceLineNo">4466</span> DatasetUtilities.findDomainBounds(d));<a name="line.4466"></a>
- <span class="sourceLineNo">4467</span> }<a name="line.4467"></a>
- <span class="sourceLineNo">4468</span> }<a name="line.4468"></a>
- <span class="sourceLineNo">4469</span> else {<a name="line.4469"></a>
- <span class="sourceLineNo">4470</span> if (r != null) {<a name="line.4470"></a>
- <span class="sourceLineNo">4471</span> result = Range.combine(result, r.findRangeBounds(d));<a name="line.4471"></a>
- <span class="sourceLineNo">4472</span> }<a name="line.4472"></a>
- <span class="sourceLineNo">4473</span> else {<a name="line.4473"></a>
- <span class="sourceLineNo">4474</span> result = Range.combine(result,<a name="line.4474"></a>
- <span class="sourceLineNo">4475</span> DatasetUtilities.findRangeBounds(d));<a name="line.4475"></a>
- <span class="sourceLineNo">4476</span> }<a name="line.4476"></a>
- <span class="sourceLineNo">4477</span> }<a name="line.4477"></a>
- <span class="sourceLineNo">4478</span> // FIXME: the XYItemRenderer interface doesn't specify the<a name="line.4478"></a>
- <span class="sourceLineNo">4479</span> // getAnnotations() method but it should<a name="line.4479"></a>
- <span class="sourceLineNo">4480</span> if (r instanceof AbstractXYItemRenderer) {<a name="line.4480"></a>
- <span class="sourceLineNo">4481</span> AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;<a name="line.4481"></a>
- <span class="sourceLineNo">4482</span> Collection c = rr.getAnnotations();<a name="line.4482"></a>
- <span class="sourceLineNo">4483</span> Iterator i = c.iterator();<a name="line.4483"></a>
- <span class="sourceLineNo">4484</span> while (i.hasNext()) {<a name="line.4484"></a>
- <span class="sourceLineNo">4485</span> XYAnnotation a = (XYAnnotation) i.next();<a name="line.4485"></a>
- <span class="sourceLineNo">4486</span> if (a instanceof XYAnnotationBoundsInfo) {<a name="line.4486"></a>
- <span class="sourceLineNo">4487</span> includedAnnotations.add(a);<a name="line.4487"></a>
- <span class="sourceLineNo">4488</span> }<a name="line.4488"></a>
- <span class="sourceLineNo">4489</span> }<a name="line.4489"></a>
- <span class="sourceLineNo">4490</span> }<a name="line.4490"></a>
- <span class="sourceLineNo">4491</span> }<a name="line.4491"></a>
- <span class="sourceLineNo">4492</span> }<a name="line.4492"></a>
- <span class="sourceLineNo">4493</span><a name="line.4493"></a>
- <span class="sourceLineNo">4494</span> Iterator it = includedAnnotations.iterator();<a name="line.4494"></a>
- <span class="sourceLineNo">4495</span> while (it.hasNext()) {<a name="line.4495"></a>
- <span class="sourceLineNo">4496</span> XYAnnotationBoundsInfo xyabi = (XYAnnotationBoundsInfo) it.next();<a name="line.4496"></a>
- <span class="sourceLineNo">4497</span> if (xyabi.getIncludeInDataBounds()) {<a name="line.4497"></a>
- <span class="sourceLineNo">4498</span> if (isDomainAxis) {<a name="line.4498"></a>
- <span class="sourceLineNo">4499</span> result = Range.combine(result, xyabi.getXRange());<a name="line.4499"></a>
- <span class="sourceLineNo">4500</span> }<a name="line.4500"></a>
- <span class="sourceLineNo">4501</span> else {<a name="line.4501"></a>
- <span class="sourceLineNo">4502</span> result = Range.combine(result, xyabi.getYRange());<a name="line.4502"></a>
- <span class="sourceLineNo">4503</span> }<a name="line.4503"></a>
- <span class="sourceLineNo">4504</span> }<a name="line.4504"></a>
- <span class="sourceLineNo">4505</span> }<a name="line.4505"></a>
- <span class="sourceLineNo">4506</span><a name="line.4506"></a>
- <span class="sourceLineNo">4507</span> return result;<a name="line.4507"></a>
- <span class="sourceLineNo">4508</span><a name="line.4508"></a>
- <span class="sourceLineNo">4509</span> }<a name="line.4509"></a>
- <span class="sourceLineNo">4510</span><a name="line.4510"></a>
- <span class="sourceLineNo">4511</span> /**<a name="line.4511"></a>
- <span class="sourceLineNo">4512</span> * Receives notification of a change to an {@link Annotation} added to<a name="line.4512"></a>
- <span class="sourceLineNo">4513</span> * this plot.<a name="line.4513"></a>
- <span class="sourceLineNo">4514</span> *<a name="line.4514"></a>
- <span class="sourceLineNo">4515</span> * @param event information about the event (not used here).<a name="line.4515"></a>
- <span class="sourceLineNo">4516</span> *<a name="line.4516"></a>
- <span class="sourceLineNo">4517</span> * @since 1.0.14<a name="line.4517"></a>
- <span class="sourceLineNo">4518</span> */<a name="line.4518"></a>
- <span class="sourceLineNo">4519</span> @Override<a name="line.4519"></a>
- <span class="sourceLineNo">4520</span> public void annotationChanged(AnnotationChangeEvent event) {<a name="line.4520"></a>
- <span class="sourceLineNo">4521</span> if (getParent() != null) {<a name="line.4521"></a>
- <span class="sourceLineNo">4522</span> getParent().annotationChanged(event);<a name="line.4522"></a>
- <span class="sourceLineNo">4523</span> }<a name="line.4523"></a>
- <span class="sourceLineNo">4524</span> else {<a name="line.4524"></a>
- <span class="sourceLineNo">4525</span> PlotChangeEvent e = new PlotChangeEvent(this);<a name="line.4525"></a>
- <span class="sourceLineNo">4526</span> notifyListeners(e);<a name="line.4526"></a>
- <span class="sourceLineNo">4527</span> }<a name="line.4527"></a>
- <span class="sourceLineNo">4528</span> }<a name="line.4528"></a>
- <span class="sourceLineNo">4529</span><a name="line.4529"></a>
- <span class="sourceLineNo">4530</span> /**<a name="line.4530"></a>
- <span class="sourceLineNo">4531</span> * Receives notification of a change to the plot's dataset.<a name="line.4531"></a>
- <span class="sourceLineNo">4532</span> * <P><a name="line.4532"></a>
- <span class="sourceLineNo">4533</span> * The axis ranges are updated if necessary.<a name="line.4533"></a>
- <span class="sourceLineNo">4534</span> *<a name="line.4534"></a>
- <span class="sourceLineNo">4535</span> * @param event information about the event (not used here).<a name="line.4535"></a>
- <span class="sourceLineNo">4536</span> */<a name="line.4536"></a>
- <span class="sourceLineNo">4537</span> @Override<a name="line.4537"></a>
- <span class="sourceLineNo">4538</span> public void datasetChanged(DatasetChangeEvent event) {<a name="line.4538"></a>
- <span class="sourceLineNo">4539</span> configureDomainAxes();<a name="line.4539"></a>
- <span class="sourceLineNo">4540</span> configureRangeAxes();<a name="line.4540"></a>
- <span class="sourceLineNo">4541</span> if (getParent() != null) {<a name="line.4541"></a>
- <span class="sourceLineNo">4542</span> getParent().datasetChanged(event);<a name="line.4542"></a>
- <span class="sourceLineNo">4543</span> }<a name="line.4543"></a>
- <span class="sourceLineNo">4544</span> else {<a name="line.4544"></a>
- <span class="sourceLineNo">4545</span> PlotChangeEvent e = new PlotChangeEvent(this);<a name="line.4545"></a>
- <span class="sourceLineNo">4546</span> e.setType(ChartChangeEventType.DATASET_UPDATED);<a name="line.4546"></a>
- <span class="sourceLineNo">4547</span> notifyListeners(e);<a name="line.4547"></a>
- <span class="sourceLineNo">4548</span> }<a name="line.4548"></a>
- <span class="sourceLineNo">4549</span> }<a name="line.4549"></a>
- <span class="sourceLineNo">4550</span><a name="line.4550"></a>
- <span class="sourceLineNo">4551</span> /**<a name="line.4551"></a>
- <span class="sourceLineNo">4552</span> * Receives notification of a renderer change event.<a name="line.4552"></a>
- <span class="sourceLineNo">4553</span> *<a name="line.4553"></a>
- <span class="sourceLineNo">4554</span> * @param event the event.<a name="line.4554"></a>
- <span class="sourceLineNo">4555</span> */<a name="line.4555"></a>
- <span class="sourceLineNo">4556</span> @Override<a name="line.4556"></a>
- <span class="sourceLineNo">4557</span> public void rendererChanged(RendererChangeEvent event) {<a name="line.4557"></a>
- <span class="sourceLineNo">4558</span> // if the event was caused by a change to series visibility, then<a name="line.4558"></a>
- <span class="sourceLineNo">4559</span> // the axis ranges might need updating...<a name="line.4559"></a>
- <span class="sourceLineNo">4560</span> if (event.getSeriesVisibilityChanged()) {<a name="line.4560"></a>
- <span class="sourceLineNo">4561</span> configureDomainAxes();<a name="line.4561"></a>
- <span class="sourceLineNo">4562</span> configureRangeAxes();<a name="line.4562"></a>
- <span class="sourceLineNo">4563</span> }<a name="line.4563"></a>
- <span class="sourceLineNo">4564</span> fireChangeEvent();<a name="line.4564"></a>
- <span class="sourceLineNo">4565</span> }<a name="line.4565"></a>
- <span class="sourceLineNo">4566</span><a name="line.4566"></a>
- <span class="sourceLineNo">4567</span> /**<a name="line.4567"></a>
- <span class="sourceLineNo">4568</span> * Returns a flag indicating whether or not the domain crosshair is visible.<a name="line.4568"></a>
- <span class="sourceLineNo">4569</span> *<a name="line.4569"></a>
- <span class="sourceLineNo">4570</span> * @return The flag.<a name="line.4570"></a>
- <span class="sourceLineNo">4571</span> *<a name="line.4571"></a>
- <span class="sourceLineNo">4572</span> * @see #setDomainCrosshairVisible(boolean)<a name="line.4572"></a>
- <span class="sourceLineNo">4573</span> */<a name="line.4573"></a>
- <span class="sourceLineNo">4574</span> public boolean isDomainCrosshairVisible() {<a name="line.4574"></a>
- <span class="sourceLineNo">4575</span> return this.domainCrosshairVisible;<a name="line.4575"></a>
- <span class="sourceLineNo">4576</span> }<a name="line.4576"></a>
- <span class="sourceLineNo">4577</span><a name="line.4577"></a>
- <span class="sourceLineNo">4578</span> /**<a name="line.4578"></a>
- <span class="sourceLineNo">4579</span> * Sets the flag indicating whether or not the domain crosshair is visible<a name="line.4579"></a>
- <span class="sourceLineNo">4580</span> * and, if the flag changes, sends a {@link PlotChangeEvent} to all<a name="line.4580"></a>
- <span class="sourceLineNo">4581</span> * registered listeners.<a name="line.4581"></a>
- <span class="sourceLineNo">4582</span> *<a name="line.4582"></a>
- <span class="sourceLineNo">4583</span> * @param flag the new value of the flag.<a name="line.4583"></a>
- <span class="sourceLineNo">4584</span> *<a name="line.4584"></a>
- <span class="sourceLineNo">4585</span> * @see #isDomainCrosshairVisible()<a name="line.4585"></a>
- <span class="sourceLineNo">4586</span> */<a name="line.4586"></a>
- <span class="sourceLineNo">4587</span> public void setDomainCrosshairVisible(boolean flag) {<a name="line.4587"></a>
- <span class="sourceLineNo">4588</span> if (this.domainCrosshairVisible != flag) {<a name="line.4588"></a>
- <span class="sourceLineNo">4589</span> this.domainCrosshairVisible = flag;<a name="line.4589"></a>
- <span class="sourceLineNo">4590</span> fireChangeEvent();<a name="line.4590"></a>
- <span class="sourceLineNo">4591</span> }<a name="line.4591"></a>
- <span class="sourceLineNo">4592</span> }<a name="line.4592"></a>
- <span class="sourceLineNo">4593</span><a name="line.4593"></a>
- <span class="sourceLineNo">4594</span> /**<a name="line.4594"></a>
- <span class="sourceLineNo">4595</span> * Returns a flag indicating whether or not the crosshair should "lock-on"<a name="line.4595"></a>
- <span class="sourceLineNo">4596</span> * to actual data values.<a name="line.4596"></a>
- <span class="sourceLineNo">4597</span> *<a name="line.4597"></a>
- <span class="sourceLineNo">4598</span> * @return The flag.<a name="line.4598"></a>
- <span class="sourceLineNo">4599</span> *<a name="line.4599"></a>
- <span class="sourceLineNo">4600</span> * @see #setDomainCrosshairLockedOnData(boolean)<a name="line.4600"></a>
- <span class="sourceLineNo">4601</span> */<a name="line.4601"></a>
- <span class="sourceLineNo">4602</span> public boolean isDomainCrosshairLockedOnData() {<a name="line.4602"></a>
- <span class="sourceLineNo">4603</span> return this.domainCrosshairLockedOnData;<a name="line.4603"></a>
- <span class="sourceLineNo">4604</span> }<a name="line.4604"></a>
- <span class="sourceLineNo">4605</span><a name="line.4605"></a>
- <span class="sourceLineNo">4606</span> /**<a name="line.4606"></a>
- <span class="sourceLineNo">4607</span> * Sets the flag indicating whether or not the domain crosshair should<a name="line.4607"></a>
- <span class="sourceLineNo">4608</span> * "lock-on" to actual data values. If the flag value changes, this<a name="line.4608"></a>
- <span class="sourceLineNo">4609</span> * method sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.4609"></a>
- <span class="sourceLineNo">4610</span> *<a name="line.4610"></a>
- <span class="sourceLineNo">4611</span> * @param flag the flag.<a name="line.4611"></a>
- <span class="sourceLineNo">4612</span> *<a name="line.4612"></a>
- <span class="sourceLineNo">4613</span> * @see #isDomainCrosshairLockedOnData()<a name="line.4613"></a>
- <span class="sourceLineNo">4614</span> */<a name="line.4614"></a>
- <span class="sourceLineNo">4615</span> public void setDomainCrosshairLockedOnData(boolean flag) {<a name="line.4615"></a>
- <span class="sourceLineNo">4616</span> if (this.domainCrosshairLockedOnData != flag) {<a name="line.4616"></a>
- <span class="sourceLineNo">4617</span> this.domainCrosshairLockedOnData = flag;<a name="line.4617"></a>
- <span class="sourceLineNo">4618</span> fireChangeEvent();<a name="line.4618"></a>
- <span class="sourceLineNo">4619</span> }<a name="line.4619"></a>
- <span class="sourceLineNo">4620</span> }<a name="line.4620"></a>
- <span class="sourceLineNo">4621</span><a name="line.4621"></a>
- <span class="sourceLineNo">4622</span> /**<a name="line.4622"></a>
- <span class="sourceLineNo">4623</span> * Returns the domain crosshair value.<a name="line.4623"></a>
- <span class="sourceLineNo">4624</span> *<a name="line.4624"></a>
- <span class="sourceLineNo">4625</span> * @return The value.<a name="line.4625"></a>
- <span class="sourceLineNo">4626</span> *<a name="line.4626"></a>
- <span class="sourceLineNo">4627</span> * @see #setDomainCrosshairValue(double)<a name="line.4627"></a>
- <span class="sourceLineNo">4628</span> */<a name="line.4628"></a>
- <span class="sourceLineNo">4629</span> public double getDomainCrosshairValue() {<a name="line.4629"></a>
- <span class="sourceLineNo">4630</span> return this.domainCrosshairValue;<a name="line.4630"></a>
- <span class="sourceLineNo">4631</span> }<a name="line.4631"></a>
- <span class="sourceLineNo">4632</span><a name="line.4632"></a>
- <span class="sourceLineNo">4633</span> /**<a name="line.4633"></a>
- <span class="sourceLineNo">4634</span> * Sets the domain crosshair value and sends a {@link PlotChangeEvent} to<a name="line.4634"></a>
- <span class="sourceLineNo">4635</span> * all registered listeners (provided that the domain crosshair is visible).<a name="line.4635"></a>
- <span class="sourceLineNo">4636</span> *<a name="line.4636"></a>
- <span class="sourceLineNo">4637</span> * @param value the value.<a name="line.4637"></a>
- <span class="sourceLineNo">4638</span> *<a name="line.4638"></a>
- <span class="sourceLineNo">4639</span> * @see #getDomainCrosshairValue()<a name="line.4639"></a>
- <span class="sourceLineNo">4640</span> */<a name="line.4640"></a>
- <span class="sourceLineNo">4641</span> public void setDomainCrosshairValue(double value) {<a name="line.4641"></a>
- <span class="sourceLineNo">4642</span> setDomainCrosshairValue(value, true);<a name="line.4642"></a>
- <span class="sourceLineNo">4643</span> }<a name="line.4643"></a>
- <span class="sourceLineNo">4644</span><a name="line.4644"></a>
- <span class="sourceLineNo">4645</span> /**<a name="line.4645"></a>
- <span class="sourceLineNo">4646</span> * Sets the domain crosshair value and, if requested, sends a<a name="line.4646"></a>
- <span class="sourceLineNo">4647</span> * {@link PlotChangeEvent} to all registered listeners (provided that the<a name="line.4647"></a>
- <span class="sourceLineNo">4648</span> * domain crosshair is visible).<a name="line.4648"></a>
- <span class="sourceLineNo">4649</span> *<a name="line.4649"></a>
- <span class="sourceLineNo">4650</span> * @param value the new value.<a name="line.4650"></a>
- <span class="sourceLineNo">4651</span> * @param notify notify listeners?<a name="line.4651"></a>
- <span class="sourceLineNo">4652</span> *<a name="line.4652"></a>
- <span class="sourceLineNo">4653</span> * @see #getDomainCrosshairValue()<a name="line.4653"></a>
- <span class="sourceLineNo">4654</span> */<a name="line.4654"></a>
- <span class="sourceLineNo">4655</span> public void setDomainCrosshairValue(double value, boolean notify) {<a name="line.4655"></a>
- <span class="sourceLineNo">4656</span> this.domainCrosshairValue = value;<a name="line.4656"></a>
- <span class="sourceLineNo">4657</span> if (isDomainCrosshairVisible() && notify) {<a name="line.4657"></a>
- <span class="sourceLineNo">4658</span> fireChangeEvent();<a name="line.4658"></a>
- <span class="sourceLineNo">4659</span> }<a name="line.4659"></a>
- <span class="sourceLineNo">4660</span> }<a name="line.4660"></a>
- <span class="sourceLineNo">4661</span><a name="line.4661"></a>
- <span class="sourceLineNo">4662</span> /**<a name="line.4662"></a>
- <span class="sourceLineNo">4663</span> * Returns the {@link Stroke} used to draw the crosshair (if visible).<a name="line.4663"></a>
- <span class="sourceLineNo">4664</span> *<a name="line.4664"></a>
- <span class="sourceLineNo">4665</span> * @return The crosshair stroke (never <code>null</code>).<a name="line.4665"></a>
- <span class="sourceLineNo">4666</span> *<a name="line.4666"></a>
- <span class="sourceLineNo">4667</span> * @see #setDomainCrosshairStroke(Stroke)<a name="line.4667"></a>
- <span class="sourceLineNo">4668</span> * @see #isDomainCrosshairVisible()<a name="line.4668"></a>
- <span class="sourceLineNo">4669</span> * @see #getDomainCrosshairPaint()<a name="line.4669"></a>
- <span class="sourceLineNo">4670</span> */<a name="line.4670"></a>
- <span class="sourceLineNo">4671</span> public Stroke getDomainCrosshairStroke() {<a name="line.4671"></a>
- <span class="sourceLineNo">4672</span> return this.domainCrosshairStroke;<a name="line.4672"></a>
- <span class="sourceLineNo">4673</span> }<a name="line.4673"></a>
- <span class="sourceLineNo">4674</span><a name="line.4674"></a>
- <span class="sourceLineNo">4675</span> /**<a name="line.4675"></a>
- <span class="sourceLineNo">4676</span> * Sets the Stroke used to draw the crosshairs (if visible) and notifies<a name="line.4676"></a>
- <span class="sourceLineNo">4677</span> * registered listeners that the axis has been modified.<a name="line.4677"></a>
- <span class="sourceLineNo">4678</span> *<a name="line.4678"></a>
- <span class="sourceLineNo">4679</span> * @param stroke the new crosshair stroke (<code>null</code> not<a name="line.4679"></a>
- <span class="sourceLineNo">4680</span> * permitted).<a name="line.4680"></a>
- <span class="sourceLineNo">4681</span> *<a name="line.4681"></a>
- <span class="sourceLineNo">4682</span> * @see #getDomainCrosshairStroke()<a name="line.4682"></a>
- <span class="sourceLineNo">4683</span> */<a name="line.4683"></a>
- <span class="sourceLineNo">4684</span> public void setDomainCrosshairStroke(Stroke stroke) {<a name="line.4684"></a>
- <span class="sourceLineNo">4685</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.4685"></a>
- <span class="sourceLineNo">4686</span> this.domainCrosshairStroke = stroke;<a name="line.4686"></a>
- <span class="sourceLineNo">4687</span> fireChangeEvent();<a name="line.4687"></a>
- <span class="sourceLineNo">4688</span> }<a name="line.4688"></a>
- <span class="sourceLineNo">4689</span><a name="line.4689"></a>
- <span class="sourceLineNo">4690</span> /**<a name="line.4690"></a>
- <span class="sourceLineNo">4691</span> * Returns the domain crosshair paint.<a name="line.4691"></a>
- <span class="sourceLineNo">4692</span> *<a name="line.4692"></a>
- <span class="sourceLineNo">4693</span> * @return The crosshair paint (never <code>null</code>).<a name="line.4693"></a>
- <span class="sourceLineNo">4694</span> *<a name="line.4694"></a>
- <span class="sourceLineNo">4695</span> * @see #setDomainCrosshairPaint(Paint)<a name="line.4695"></a>
- <span class="sourceLineNo">4696</span> * @see #isDomainCrosshairVisible()<a name="line.4696"></a>
- <span class="sourceLineNo">4697</span> * @see #getDomainCrosshairStroke()<a name="line.4697"></a>
- <span class="sourceLineNo">4698</span> */<a name="line.4698"></a>
- <span class="sourceLineNo">4699</span> public Paint getDomainCrosshairPaint() {<a name="line.4699"></a>
- <span class="sourceLineNo">4700</span> return this.domainCrosshairPaint;<a name="line.4700"></a>
- <span class="sourceLineNo">4701</span> }<a name="line.4701"></a>
- <span class="sourceLineNo">4702</span><a name="line.4702"></a>
- <span class="sourceLineNo">4703</span> /**<a name="line.4703"></a>
- <span class="sourceLineNo">4704</span> * Sets the paint used to draw the crosshairs (if visible) and sends a<a name="line.4704"></a>
- <span class="sourceLineNo">4705</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.4705"></a>
- <span class="sourceLineNo">4706</span> *<a name="line.4706"></a>
- <span class="sourceLineNo">4707</span> * @param paint the new crosshair paint (<code>null</code> not permitted).<a name="line.4707"></a>
- <span class="sourceLineNo">4708</span> *<a name="line.4708"></a>
- <span class="sourceLineNo">4709</span> * @see #getDomainCrosshairPaint()<a name="line.4709"></a>
- <span class="sourceLineNo">4710</span> */<a name="line.4710"></a>
- <span class="sourceLineNo">4711</span> public void setDomainCrosshairPaint(Paint paint) {<a name="line.4711"></a>
- <span class="sourceLineNo">4712</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.4712"></a>
- <span class="sourceLineNo">4713</span> this.domainCrosshairPaint = paint;<a name="line.4713"></a>
- <span class="sourceLineNo">4714</span> fireChangeEvent();<a name="line.4714"></a>
- <span class="sourceLineNo">4715</span> }<a name="line.4715"></a>
- <span class="sourceLineNo">4716</span><a name="line.4716"></a>
- <span class="sourceLineNo">4717</span> /**<a name="line.4717"></a>
- <span class="sourceLineNo">4718</span> * Returns a flag indicating whether or not the range crosshair is visible.<a name="line.4718"></a>
- <span class="sourceLineNo">4719</span> *<a name="line.4719"></a>
- <span class="sourceLineNo">4720</span> * @return The flag.<a name="line.4720"></a>
- <span class="sourceLineNo">4721</span> *<a name="line.4721"></a>
- <span class="sourceLineNo">4722</span> * @see #setRangeCrosshairVisible(boolean)<a name="line.4722"></a>
- <span class="sourceLineNo">4723</span> * @see #isDomainCrosshairVisible()<a name="line.4723"></a>
- <span class="sourceLineNo">4724</span> */<a name="line.4724"></a>
- <span class="sourceLineNo">4725</span> public boolean isRangeCrosshairVisible() {<a name="line.4725"></a>
- <span class="sourceLineNo">4726</span> return this.rangeCrosshairVisible;<a name="line.4726"></a>
- <span class="sourceLineNo">4727</span> }<a name="line.4727"></a>
- <span class="sourceLineNo">4728</span><a name="line.4728"></a>
- <span class="sourceLineNo">4729</span> /**<a name="line.4729"></a>
- <span class="sourceLineNo">4730</span> * Sets the flag indicating whether or not the range crosshair is visible.<a name="line.4730"></a>
- <span class="sourceLineNo">4731</span> * If the flag value changes, this method sends a {@link PlotChangeEvent}<a name="line.4731"></a>
- <span class="sourceLineNo">4732</span> * to all registered listeners.<a name="line.4732"></a>
- <span class="sourceLineNo">4733</span> *<a name="line.4733"></a>
- <span class="sourceLineNo">4734</span> * @param flag the new value of the flag.<a name="line.4734"></a>
- <span class="sourceLineNo">4735</span> *<a name="line.4735"></a>
- <span class="sourceLineNo">4736</span> * @see #isRangeCrosshairVisible()<a name="line.4736"></a>
- <span class="sourceLineNo">4737</span> */<a name="line.4737"></a>
- <span class="sourceLineNo">4738</span> public void setRangeCrosshairVisible(boolean flag) {<a name="line.4738"></a>
- <span class="sourceLineNo">4739</span> if (this.rangeCrosshairVisible != flag) {<a name="line.4739"></a>
- <span class="sourceLineNo">4740</span> this.rangeCrosshairVisible = flag;<a name="line.4740"></a>
- <span class="sourceLineNo">4741</span> fireChangeEvent();<a name="line.4741"></a>
- <span class="sourceLineNo">4742</span> }<a name="line.4742"></a>
- <span class="sourceLineNo">4743</span> }<a name="line.4743"></a>
- <span class="sourceLineNo">4744</span><a name="line.4744"></a>
- <span class="sourceLineNo">4745</span> /**<a name="line.4745"></a>
- <span class="sourceLineNo">4746</span> * Returns a flag indicating whether or not the crosshair should "lock-on"<a name="line.4746"></a>
- <span class="sourceLineNo">4747</span> * to actual data values.<a name="line.4747"></a>
- <span class="sourceLineNo">4748</span> *<a name="line.4748"></a>
- <span class="sourceLineNo">4749</span> * @return The flag.<a name="line.4749"></a>
- <span class="sourceLineNo">4750</span> *<a name="line.4750"></a>
- <span class="sourceLineNo">4751</span> * @see #setRangeCrosshairLockedOnData(boolean)<a name="line.4751"></a>
- <span class="sourceLineNo">4752</span> */<a name="line.4752"></a>
- <span class="sourceLineNo">4753</span> public boolean isRangeCrosshairLockedOnData() {<a name="line.4753"></a>
- <span class="sourceLineNo">4754</span> return this.rangeCrosshairLockedOnData;<a name="line.4754"></a>
- <span class="sourceLineNo">4755</span> }<a name="line.4755"></a>
- <span class="sourceLineNo">4756</span><a name="line.4756"></a>
- <span class="sourceLineNo">4757</span> /**<a name="line.4757"></a>
- <span class="sourceLineNo">4758</span> * Sets the flag indicating whether or not the range crosshair should<a name="line.4758"></a>
- <span class="sourceLineNo">4759</span> * "lock-on" to actual data values. If the flag value changes, this method<a name="line.4759"></a>
- <span class="sourceLineNo">4760</span> * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.4760"></a>
- <span class="sourceLineNo">4761</span> *<a name="line.4761"></a>
- <span class="sourceLineNo">4762</span> * @param flag the flag.<a name="line.4762"></a>
- <span class="sourceLineNo">4763</span> *<a name="line.4763"></a>
- <span class="sourceLineNo">4764</span> * @see #isRangeCrosshairLockedOnData()<a name="line.4764"></a>
- <span class="sourceLineNo">4765</span> */<a name="line.4765"></a>
- <span class="sourceLineNo">4766</span> public void setRangeCrosshairLockedOnData(boolean flag) {<a name="line.4766"></a>
- <span class="sourceLineNo">4767</span> if (this.rangeCrosshairLockedOnData != flag) {<a name="line.4767"></a>
- <span class="sourceLineNo">4768</span> this.rangeCrosshairLockedOnData = flag;<a name="line.4768"></a>
- <span class="sourceLineNo">4769</span> fireChangeEvent();<a name="line.4769"></a>
- <span class="sourceLineNo">4770</span> }<a name="line.4770"></a>
- <span class="sourceLineNo">4771</span> }<a name="line.4771"></a>
- <span class="sourceLineNo">4772</span><a name="line.4772"></a>
- <span class="sourceLineNo">4773</span> /**<a name="line.4773"></a>
- <span class="sourceLineNo">4774</span> * Returns the range crosshair value.<a name="line.4774"></a>
- <span class="sourceLineNo">4775</span> *<a name="line.4775"></a>
- <span class="sourceLineNo">4776</span> * @return The value.<a name="line.4776"></a>
- <span class="sourceLineNo">4777</span> *<a name="line.4777"></a>
- <span class="sourceLineNo">4778</span> * @see #setRangeCrosshairValue(double)<a name="line.4778"></a>
- <span class="sourceLineNo">4779</span> */<a name="line.4779"></a>
- <span class="sourceLineNo">4780</span> public double getRangeCrosshairValue() {<a name="line.4780"></a>
- <span class="sourceLineNo">4781</span> return this.rangeCrosshairValue;<a name="line.4781"></a>
- <span class="sourceLineNo">4782</span> }<a name="line.4782"></a>
- <span class="sourceLineNo">4783</span><a name="line.4783"></a>
- <span class="sourceLineNo">4784</span> /**<a name="line.4784"></a>
- <span class="sourceLineNo">4785</span> * Sets the range crosshair value.<a name="line.4785"></a>
- <span class="sourceLineNo">4786</span> * <P><a name="line.4786"></a>
- <span class="sourceLineNo">4787</span> * Registered listeners are notified that the plot has been modified, but<a name="line.4787"></a>
- <span class="sourceLineNo">4788</span> * only if the crosshair is visible.<a name="line.4788"></a>
- <span class="sourceLineNo">4789</span> *<a name="line.4789"></a>
- <span class="sourceLineNo">4790</span> * @param value the new value.<a name="line.4790"></a>
- <span class="sourceLineNo">4791</span> *<a name="line.4791"></a>
- <span class="sourceLineNo">4792</span> * @see #getRangeCrosshairValue()<a name="line.4792"></a>
- <span class="sourceLineNo">4793</span> */<a name="line.4793"></a>
- <span class="sourceLineNo">4794</span> public void setRangeCrosshairValue(double value) {<a name="line.4794"></a>
- <span class="sourceLineNo">4795</span> setRangeCrosshairValue(value, true);<a name="line.4795"></a>
- <span class="sourceLineNo">4796</span> }<a name="line.4796"></a>
- <span class="sourceLineNo">4797</span><a name="line.4797"></a>
- <span class="sourceLineNo">4798</span> /**<a name="line.4798"></a>
- <span class="sourceLineNo">4799</span> * Sets the range crosshair value and sends a {@link PlotChangeEvent} to<a name="line.4799"></a>
- <span class="sourceLineNo">4800</span> * all registered listeners, but only if the crosshair is visible.<a name="line.4800"></a>
- <span class="sourceLineNo">4801</span> *<a name="line.4801"></a>
- <span class="sourceLineNo">4802</span> * @param value the new value.<a name="line.4802"></a>
- <span class="sourceLineNo">4803</span> * @param notify a flag that controls whether or not listeners are<a name="line.4803"></a>
- <span class="sourceLineNo">4804</span> * notified.<a name="line.4804"></a>
- <span class="sourceLineNo">4805</span> *<a name="line.4805"></a>
- <span class="sourceLineNo">4806</span> * @see #getRangeCrosshairValue()<a name="line.4806"></a>
- <span class="sourceLineNo">4807</span> */<a name="line.4807"></a>
- <span class="sourceLineNo">4808</span> public void setRangeCrosshairValue(double value, boolean notify) {<a name="line.4808"></a>
- <span class="sourceLineNo">4809</span> this.rangeCrosshairValue = value;<a name="line.4809"></a>
- <span class="sourceLineNo">4810</span> if (isRangeCrosshairVisible() && notify) {<a name="line.4810"></a>
- <span class="sourceLineNo">4811</span> fireChangeEvent();<a name="line.4811"></a>
- <span class="sourceLineNo">4812</span> }<a name="line.4812"></a>
- <span class="sourceLineNo">4813</span> }<a name="line.4813"></a>
- <span class="sourceLineNo">4814</span><a name="line.4814"></a>
- <span class="sourceLineNo">4815</span> /**<a name="line.4815"></a>
- <span class="sourceLineNo">4816</span> * Returns the stroke used to draw the crosshair (if visible).<a name="line.4816"></a>
- <span class="sourceLineNo">4817</span> *<a name="line.4817"></a>
- <span class="sourceLineNo">4818</span> * @return The crosshair stroke (never <code>null</code>).<a name="line.4818"></a>
- <span class="sourceLineNo">4819</span> *<a name="line.4819"></a>
- <span class="sourceLineNo">4820</span> * @see #setRangeCrosshairStroke(Stroke)<a name="line.4820"></a>
- <span class="sourceLineNo">4821</span> * @see #isRangeCrosshairVisible()<a name="line.4821"></a>
- <span class="sourceLineNo">4822</span> * @see #getRangeCrosshairPaint()<a name="line.4822"></a>
- <span class="sourceLineNo">4823</span> */<a name="line.4823"></a>
- <span class="sourceLineNo">4824</span> public Stroke getRangeCrosshairStroke() {<a name="line.4824"></a>
- <span class="sourceLineNo">4825</span> return this.rangeCrosshairStroke;<a name="line.4825"></a>
- <span class="sourceLineNo">4826</span> }<a name="line.4826"></a>
- <span class="sourceLineNo">4827</span><a name="line.4827"></a>
- <span class="sourceLineNo">4828</span> /**<a name="line.4828"></a>
- <span class="sourceLineNo">4829</span> * Sets the stroke used to draw the crosshairs (if visible) and sends a<a name="line.4829"></a>
- <span class="sourceLineNo">4830</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.4830"></a>
- <span class="sourceLineNo">4831</span> *<a name="line.4831"></a>
- <span class="sourceLineNo">4832</span> * @param stroke the new crosshair stroke (<code>null</code> not<a name="line.4832"></a>
- <span class="sourceLineNo">4833</span> * permitted).<a name="line.4833"></a>
- <span class="sourceLineNo">4834</span> *<a name="line.4834"></a>
- <span class="sourceLineNo">4835</span> * @see #getRangeCrosshairStroke()<a name="line.4835"></a>
- <span class="sourceLineNo">4836</span> */<a name="line.4836"></a>
- <span class="sourceLineNo">4837</span> public void setRangeCrosshairStroke(Stroke stroke) {<a name="line.4837"></a>
- <span class="sourceLineNo">4838</span> ParamChecks.nullNotPermitted(stroke, "stroke");<a name="line.4838"></a>
- <span class="sourceLineNo">4839</span> this.rangeCrosshairStroke = stroke;<a name="line.4839"></a>
- <span class="sourceLineNo">4840</span> fireChangeEvent();<a name="line.4840"></a>
- <span class="sourceLineNo">4841</span> }<a name="line.4841"></a>
- <span class="sourceLineNo">4842</span><a name="line.4842"></a>
- <span class="sourceLineNo">4843</span> /**<a name="line.4843"></a>
- <span class="sourceLineNo">4844</span> * Returns the range crosshair paint.<a name="line.4844"></a>
- <span class="sourceLineNo">4845</span> *<a name="line.4845"></a>
- <span class="sourceLineNo">4846</span> * @return The crosshair paint (never <code>null</code>).<a name="line.4846"></a>
- <span class="sourceLineNo">4847</span> *<a name="line.4847"></a>
- <span class="sourceLineNo">4848</span> * @see #setRangeCrosshairPaint(Paint)<a name="line.4848"></a>
- <span class="sourceLineNo">4849</span> * @see #isRangeCrosshairVisible()<a name="line.4849"></a>
- <span class="sourceLineNo">4850</span> * @see #getRangeCrosshairStroke()<a name="line.4850"></a>
- <span class="sourceLineNo">4851</span> */<a name="line.4851"></a>
- <span class="sourceLineNo">4852</span> public Paint getRangeCrosshairPaint() {<a name="line.4852"></a>
- <span class="sourceLineNo">4853</span> return this.rangeCrosshairPaint;<a name="line.4853"></a>
- <span class="sourceLineNo">4854</span> }<a name="line.4854"></a>
- <span class="sourceLineNo">4855</span><a name="line.4855"></a>
- <span class="sourceLineNo">4856</span> /**<a name="line.4856"></a>
- <span class="sourceLineNo">4857</span> * Sets the paint used to color the crosshairs (if visible) and sends a<a name="line.4857"></a>
- <span class="sourceLineNo">4858</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.4858"></a>
- <span class="sourceLineNo">4859</span> *<a name="line.4859"></a>
- <span class="sourceLineNo">4860</span> * @param paint the new crosshair paint (<code>null</code> not permitted).<a name="line.4860"></a>
- <span class="sourceLineNo">4861</span> *<a name="line.4861"></a>
- <span class="sourceLineNo">4862</span> * @see #getRangeCrosshairPaint()<a name="line.4862"></a>
- <span class="sourceLineNo">4863</span> */<a name="line.4863"></a>
- <span class="sourceLineNo">4864</span> public void setRangeCrosshairPaint(Paint paint) {<a name="line.4864"></a>
- <span class="sourceLineNo">4865</span> ParamChecks.nullNotPermitted(paint, "paint");<a name="line.4865"></a>
- <span class="sourceLineNo">4866</span> this.rangeCrosshairPaint = paint;<a name="line.4866"></a>
- <span class="sourceLineNo">4867</span> fireChangeEvent();<a name="line.4867"></a>
- <span class="sourceLineNo">4868</span> }<a name="line.4868"></a>
- <span class="sourceLineNo">4869</span><a name="line.4869"></a>
- <span class="sourceLineNo">4870</span> /**<a name="line.4870"></a>
- <span class="sourceLineNo">4871</span> * Returns the fixed domain axis space.<a name="line.4871"></a>
- <span class="sourceLineNo">4872</span> *<a name="line.4872"></a>
- <span class="sourceLineNo">4873</span> * @return The fixed domain axis space (possibly <code>null</code>).<a name="line.4873"></a>
- <span class="sourceLineNo">4874</span> *<a name="line.4874"></a>
- <span class="sourceLineNo">4875</span> * @see #setFixedDomainAxisSpace(AxisSpace)<a name="line.4875"></a>
- <span class="sourceLineNo">4876</span> */<a name="line.4876"></a>
- <span class="sourceLineNo">4877</span> public AxisSpace getFixedDomainAxisSpace() {<a name="line.4877"></a>
- <span class="sourceLineNo">4878</span> return this.fixedDomainAxisSpace;<a name="line.4878"></a>
- <span class="sourceLineNo">4879</span> }<a name="line.4879"></a>
- <span class="sourceLineNo">4880</span><a name="line.4880"></a>
- <span class="sourceLineNo">4881</span> /**<a name="line.4881"></a>
- <span class="sourceLineNo">4882</span> * Sets the fixed domain axis space and sends a {@link PlotChangeEvent} to<a name="line.4882"></a>
- <span class="sourceLineNo">4883</span> * all registered listeners.<a name="line.4883"></a>
- <span class="sourceLineNo">4884</span> *<a name="line.4884"></a>
- <span class="sourceLineNo">4885</span> * @param space the space (<code>null</code> permitted).<a name="line.4885"></a>
- <span class="sourceLineNo">4886</span> *<a name="line.4886"></a>
- <span class="sourceLineNo">4887</span> * @see #getFixedDomainAxisSpace()<a name="line.4887"></a>
- <span class="sourceLineNo">4888</span> */<a name="line.4888"></a>
- <span class="sourceLineNo">4889</span> public void setFixedDomainAxisSpace(AxisSpace space) {<a name="line.4889"></a>
- <span class="sourceLineNo">4890</span> setFixedDomainAxisSpace(space, true);<a name="line.4890"></a>
- <span class="sourceLineNo">4891</span> }<a name="line.4891"></a>
- <span class="sourceLineNo">4892</span><a name="line.4892"></a>
- <span class="sourceLineNo">4893</span> /**<a name="line.4893"></a>
- <span class="sourceLineNo">4894</span> * Sets the fixed domain axis space and, if requested, sends a<a name="line.4894"></a>
- <span class="sourceLineNo">4895</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.4895"></a>
- <span class="sourceLineNo">4896</span> *<a name="line.4896"></a>
- <span class="sourceLineNo">4897</span> * @param space the space (<code>null</code> permitted).<a name="line.4897"></a>
- <span class="sourceLineNo">4898</span> * @param notify notify listeners?<a name="line.4898"></a>
- <span class="sourceLineNo">4899</span> *<a name="line.4899"></a>
- <span class="sourceLineNo">4900</span> * @see #getFixedDomainAxisSpace()<a name="line.4900"></a>
- <span class="sourceLineNo">4901</span> *<a name="line.4901"></a>
- <span class="sourceLineNo">4902</span> * @since 1.0.9<a name="line.4902"></a>
- <span class="sourceLineNo">4903</span> */<a name="line.4903"></a>
- <span class="sourceLineNo">4904</span> public void setFixedDomainAxisSpace(AxisSpace space, boolean notify) {<a name="line.4904"></a>
- <span class="sourceLineNo">4905</span> this.fixedDomainAxisSpace = space;<a name="line.4905"></a>
- <span class="sourceLineNo">4906</span> if (notify) {<a name="line.4906"></a>
- <span class="sourceLineNo">4907</span> fireChangeEvent();<a name="line.4907"></a>
- <span class="sourceLineNo">4908</span> }<a name="line.4908"></a>
- <span class="sourceLineNo">4909</span> }<a name="line.4909"></a>
- <span class="sourceLineNo">4910</span><a name="line.4910"></a>
- <span class="sourceLineNo">4911</span> /**<a name="line.4911"></a>
- <span class="sourceLineNo">4912</span> * Returns the fixed range axis space.<a name="line.4912"></a>
- <span class="sourceLineNo">4913</span> *<a name="line.4913"></a>
- <span class="sourceLineNo">4914</span> * @return The fixed range axis space (possibly <code>null</code>).<a name="line.4914"></a>
- <span class="sourceLineNo">4915</span> *<a name="line.4915"></a>
- <span class="sourceLineNo">4916</span> * @see #setFixedRangeAxisSpace(AxisSpace)<a name="line.4916"></a>
- <span class="sourceLineNo">4917</span> */<a name="line.4917"></a>
- <span class="sourceLineNo">4918</span> public AxisSpace getFixedRangeAxisSpace() {<a name="line.4918"></a>
- <span class="sourceLineNo">4919</span> return this.fixedRangeAxisSpace;<a name="line.4919"></a>
- <span class="sourceLineNo">4920</span> }<a name="line.4920"></a>
- <span class="sourceLineNo">4921</span><a name="line.4921"></a>
- <span class="sourceLineNo">4922</span> /**<a name="line.4922"></a>
- <span class="sourceLineNo">4923</span> * Sets the fixed range axis space and sends a {@link PlotChangeEvent} to<a name="line.4923"></a>
- <span class="sourceLineNo">4924</span> * all registered listeners.<a name="line.4924"></a>
- <span class="sourceLineNo">4925</span> *<a name="line.4925"></a>
- <span class="sourceLineNo">4926</span> * @param space the space (<code>null</code> permitted).<a name="line.4926"></a>
- <span class="sourceLineNo">4927</span> *<a name="line.4927"></a>
- <span class="sourceLineNo">4928</span> * @see #getFixedRangeAxisSpace()<a name="line.4928"></a>
- <span class="sourceLineNo">4929</span> */<a name="line.4929"></a>
- <span class="sourceLineNo">4930</span> public void setFixedRangeAxisSpace(AxisSpace space) {<a name="line.4930"></a>
- <span class="sourceLineNo">4931</span> setFixedRangeAxisSpace(space, true);<a name="line.4931"></a>
- <span class="sourceLineNo">4932</span> }<a name="line.4932"></a>
- <span class="sourceLineNo">4933</span><a name="line.4933"></a>
- <span class="sourceLineNo">4934</span> /**<a name="line.4934"></a>
- <span class="sourceLineNo">4935</span> * Sets the fixed range axis space and, if requested, sends a<a name="line.4935"></a>
- <span class="sourceLineNo">4936</span> * {@link PlotChangeEvent} to all registered listeners.<a name="line.4936"></a>
- <span class="sourceLineNo">4937</span> *<a name="line.4937"></a>
- <span class="sourceLineNo">4938</span> * @param space the space (<code>null</code> permitted).<a name="line.4938"></a>
- <span class="sourceLineNo">4939</span> * @param notify notify listeners?<a name="line.4939"></a>
- <span class="sourceLineNo">4940</span> *<a name="line.4940"></a>
- <span class="sourceLineNo">4941</span> * @see #getFixedRangeAxisSpace()<a name="line.4941"></a>
- <span class="sourceLineNo">4942</span> *<a name="line.4942"></a>
- <span class="sourceLineNo">4943</span> * @since 1.0.9<a name="line.4943"></a>
- <span class="sourceLineNo">4944</span> */<a name="line.4944"></a>
- <span class="sourceLineNo">4945</span> public void setFixedRangeAxisSpace(AxisSpace space, boolean notify) {<a name="line.4945"></a>
- <span class="sourceLineNo">4946</span> this.fixedRangeAxisSpace = space;<a name="line.4946"></a>
- <span class="sourceLineNo">4947</span> if (notify) {<a name="line.4947"></a>
- <span class="sourceLineNo">4948</span> fireChangeEvent();<a name="line.4948"></a>
- <span class="sourceLineNo">4949</span> }<a name="line.4949"></a>
- <span class="sourceLineNo">4950</span> }<a name="line.4950"></a>
- <span class="sourceLineNo">4951</span><a name="line.4951"></a>
- <span class="sourceLineNo">4952</span> /**<a name="line.4952"></a>
- <span class="sourceLineNo">4953</span> * Returns <code>true</code> if panning is enabled for the domain axes,<a name="line.4953"></a>
- <span class="sourceLineNo">4954</span> * and <code>false</code> otherwise.<a name="line.4954"></a>
- <span class="sourceLineNo">4955</span> *<a name="line.4955"></a>
- <span class="sourceLineNo">4956</span> * @return A boolean.<a name="line.4956"></a>
- <span class="sourceLineNo">4957</span> *<a name="line.4957"></a>
- <span class="sourceLineNo">4958</span> * @since 1.0.13<a name="line.4958"></a>
- <span class="sourceLineNo">4959</span> */<a name="line.4959"></a>
- <span class="sourceLineNo">4960</span> @Override<a name="line.4960"></a>
- <span class="sourceLineNo">4961</span> public boolean isDomainPannable() {<a name="line.4961"></a>
- <span class="sourceLineNo">4962</span> return this.domainPannable;<a name="line.4962"></a>
- <span class="sourceLineNo">4963</span> }<a name="line.4963"></a>
- <span class="sourceLineNo">4964</span><a name="line.4964"></a>
- <span class="sourceLineNo">4965</span> /**<a name="line.4965"></a>
- <span class="sourceLineNo">4966</span> * Sets the flag that enables or disables panning of the plot along the<a name="line.4966"></a>
- <span class="sourceLineNo">4967</span> * domain axes.<a name="line.4967"></a>
- <span class="sourceLineNo">4968</span> *<a name="line.4968"></a>
- <span class="sourceLineNo">4969</span> * @param pannable the new flag value.<a name="line.4969"></a>
- <span class="sourceLineNo">4970</span> *<a name="line.4970"></a>
- <span class="sourceLineNo">4971</span> * @since 1.0.13<a name="line.4971"></a>
- <span class="sourceLineNo">4972</span> */<a name="line.4972"></a>
- <span class="sourceLineNo">4973</span> public void setDomainPannable(boolean pannable) {<a name="line.4973"></a>
- <span class="sourceLineNo">4974</span> this.domainPannable = pannable;<a name="line.4974"></a>
- <span class="sourceLineNo">4975</span> }<a name="line.4975"></a>
- <span class="sourceLineNo">4976</span><a name="line.4976"></a>
- <span class="sourceLineNo">4977</span> /**<a name="line.4977"></a>
- <span class="sourceLineNo">4978</span> * Returns {@code true} if panning is enabled for the range axis/axes,<a name="line.4978"></a>
- <span class="sourceLineNo">4979</span> * and {@code false} otherwise. The default value is {@code false}.<a name="line.4979"></a>
- <span class="sourceLineNo">4980</span> *<a name="line.4980"></a>
- <span class="sourceLineNo">4981</span> * @return A boolean.<a name="line.4981"></a>
- <span class="sourceLineNo">4982</span> *<a name="line.4982"></a>
- <span class="sourceLineNo">4983</span> * @since 1.0.13<a name="line.4983"></a>
- <span class="sourceLineNo">4984</span> */<a name="line.4984"></a>
- <span class="sourceLineNo">4985</span> @Override<a name="line.4985"></a>
- <span class="sourceLineNo">4986</span> public boolean isRangePannable() {<a name="line.4986"></a>
- <span class="sourceLineNo">4987</span> return this.rangePannable;<a name="line.4987"></a>
- <span class="sourceLineNo">4988</span> }<a name="line.4988"></a>
- <span class="sourceLineNo">4989</span><a name="line.4989"></a>
- <span class="sourceLineNo">4990</span> /**<a name="line.4990"></a>
- <span class="sourceLineNo">4991</span> * Sets the flag that enables or disables panning of the plot along<a name="line.4991"></a>
- <span class="sourceLineNo">4992</span> * the range axis/axes.<a name="line.4992"></a>
- <span class="sourceLineNo">4993</span> *<a name="line.4993"></a>
- <span class="sourceLineNo">4994</span> * @param pannable the new flag value.<a name="line.4994"></a>
- <span class="sourceLineNo">4995</span> *<a name="line.4995"></a>
- <span class="sourceLineNo">4996</span> * @since 1.0.13<a name="line.4996"></a>
- <span class="sourceLineNo">4997</span> */<a name="line.4997"></a>
- <span class="sourceLineNo">4998</span> public void setRangePannable(boolean pannable) {<a name="line.4998"></a>
- <span class="sourceLineNo">4999</span> this.rangePannable = pannable;<a name="line.4999"></a>
- <span class="sourceLineNo">5000</span> }<a name="line.5000"></a>
- <span class="sourceLineNo">5001</span><a name="line.5001"></a>
- <span class="sourceLineNo">5002</span> /**<a name="line.5002"></a>
- <span class="sourceLineNo">5003</span> * Pans the domain axes by the specified percentage.<a name="line.5003"></a>
- <span class="sourceLineNo">5004</span> *<a name="line.5004"></a>
- <span class="sourceLineNo">5005</span> * @param percent the distance to pan (as a percentage of the axis length).<a name="line.5005"></a>
- <span class="sourceLineNo">5006</span> * @param info the plot info<a name="line.5006"></a>
- <span class="sourceLineNo">5007</span> * @param source the source point where the pan action started.<a name="line.5007"></a>
- <span class="sourceLineNo">5008</span> *<a name="line.5008"></a>
- <span class="sourceLineNo">5009</span> * @since 1.0.13<a name="line.5009"></a>
- <span class="sourceLineNo">5010</span> */<a name="line.5010"></a>
- <span class="sourceLineNo">5011</span> @Override<a name="line.5011"></a>
- <span class="sourceLineNo">5012</span> public void panDomainAxes(double percent, PlotRenderingInfo info,<a name="line.5012"></a>
- <span class="sourceLineNo">5013</span> Point2D source) {<a name="line.5013"></a>
- <span class="sourceLineNo">5014</span> if (!isDomainPannable()) {<a name="line.5014"></a>
- <span class="sourceLineNo">5015</span> return;<a name="line.5015"></a>
- <span class="sourceLineNo">5016</span> }<a name="line.5016"></a>
- <span class="sourceLineNo">5017</span> int domainAxisCount = getDomainAxisCount();<a name="line.5017"></a>
- <span class="sourceLineNo">5018</span> for (int i = 0; i < domainAxisCount; i++) {<a name="line.5018"></a>
- <span class="sourceLineNo">5019</span> ValueAxis axis = getDomainAxis(i);<a name="line.5019"></a>
- <span class="sourceLineNo">5020</span> if (axis == null) {<a name="line.5020"></a>
- <span class="sourceLineNo">5021</span> continue;<a name="line.5021"></a>
- <span class="sourceLineNo">5022</span> }<a name="line.5022"></a>
- <span class="sourceLineNo">5023</span> if (axis.isInverted()) {<a name="line.5023"></a>
- <span class="sourceLineNo">5024</span> percent = -percent;<a name="line.5024"></a>
- <span class="sourceLineNo">5025</span> }<a name="line.5025"></a>
- <span class="sourceLineNo">5026</span> axis.pan(percent);<a name="line.5026"></a>
- <span class="sourceLineNo">5027</span> }<a name="line.5027"></a>
- <span class="sourceLineNo">5028</span> }<a name="line.5028"></a>
- <span class="sourceLineNo">5029</span><a name="line.5029"></a>
- <span class="sourceLineNo">5030</span> /**<a name="line.5030"></a>
- <span class="sourceLineNo">5031</span> * Pans the range axes by the specified percentage.<a name="line.5031"></a>
- <span class="sourceLineNo">5032</span> *<a name="line.5032"></a>
- <span class="sourceLineNo">5033</span> * @param percent the distance to pan (as a percentage of the axis length).<a name="line.5033"></a>
- <span class="sourceLineNo">5034</span> * @param info the plot info<a name="line.5034"></a>
- <span class="sourceLineNo">5035</span> * @param source the source point where the pan action started.<a name="line.5035"></a>
- <span class="sourceLineNo">5036</span> *<a name="line.5036"></a>
- <span class="sourceLineNo">5037</span> * @since 1.0.13<a name="line.5037"></a>
- <span class="sourceLineNo">5038</span> */<a name="line.5038"></a>
- <span class="sourceLineNo">5039</span> @Override<a name="line.5039"></a>
- <span class="sourceLineNo">5040</span> public void panRangeAxes(double percent, PlotRenderingInfo info,<a name="line.5040"></a>
- <span class="sourceLineNo">5041</span> Point2D source) {<a name="line.5041"></a>
- <span class="sourceLineNo">5042</span> if (!isRangePannable()) {<a name="line.5042"></a>
- <span class="sourceLineNo">5043</span> return;<a name="line.5043"></a>
- <span class="sourceLineNo">5044</span> }<a name="line.5044"></a>
- <span class="sourceLineNo">5045</span> int rangeAxisCount = getRangeAxisCount();<a name="line.5045"></a>
- <span class="sourceLineNo">5046</span> for (int i = 0; i < rangeAxisCount; i++) {<a name="line.5046"></a>
- <span class="sourceLineNo">5047</span> ValueAxis axis = getRangeAxis(i);<a name="line.5047"></a>
- <span class="sourceLineNo">5048</span> if (axis == null) {<a name="line.5048"></a>
- <span class="sourceLineNo">5049</span> continue;<a name="line.5049"></a>
- <span class="sourceLineNo">5050</span> }<a name="line.5050"></a>
- <span class="sourceLineNo">5051</span> if (axis.isInverted()) {<a name="line.5051"></a>
- <span class="sourceLineNo">5052</span> percent = -percent;<a name="line.5052"></a>
- <span class="sourceLineNo">5053</span> }<a name="line.5053"></a>
- <span class="sourceLineNo">5054</span> axis.pan(percent);<a name="line.5054"></a>
- <span class="sourceLineNo">5055</span> }<a name="line.5055"></a>
- <span class="sourceLineNo">5056</span> }<a name="line.5056"></a>
- <span class="sourceLineNo">5057</span><a name="line.5057"></a>
- <span class="sourceLineNo">5058</span> /**<a name="line.5058"></a>
- <span class="sourceLineNo">5059</span> * Multiplies the range on the domain axis/axes by the specified factor.<a name="line.5059"></a>
- <span class="sourceLineNo">5060</span> *<a name="line.5060"></a>
- <span class="sourceLineNo">5061</span> * @param factor the zoom factor.<a name="line.5061"></a>
- <span class="sourceLineNo">5062</span> * @param info the plot rendering info.<a name="line.5062"></a>
- <span class="sourceLineNo">5063</span> * @param source the source point (in Java2D space).<a name="line.5063"></a>
- <span class="sourceLineNo">5064</span> *<a name="line.5064"></a>
- <span class="sourceLineNo">5065</span> * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D)<a name="line.5065"></a>
- <span class="sourceLineNo">5066</span> */<a name="line.5066"></a>
- <span class="sourceLineNo">5067</span> @Override<a name="line.5067"></a>
- <span class="sourceLineNo">5068</span> public void zoomDomainAxes(double factor, PlotRenderingInfo info,<a name="line.5068"></a>
- <span class="sourceLineNo">5069</span> Point2D source) {<a name="line.5069"></a>
- <span class="sourceLineNo">5070</span> // delegate to other method<a name="line.5070"></a>
- <span class="sourceLineNo">5071</span> zoomDomainAxes(factor, info, source, false);<a name="line.5071"></a>
- <span class="sourceLineNo">5072</span> }<a name="line.5072"></a>
- <span class="sourceLineNo">5073</span><a name="line.5073"></a>
- <span class="sourceLineNo">5074</span> /**<a name="line.5074"></a>
- <span class="sourceLineNo">5075</span> * Multiplies the range on the domain axis/axes by the specified factor.<a name="line.5075"></a>
- <span class="sourceLineNo">5076</span> *<a name="line.5076"></a>
- <span class="sourceLineNo">5077</span> * @param factor the zoom factor.<a name="line.5077"></a>
- <span class="sourceLineNo">5078</span> * @param info the plot rendering info.<a name="line.5078"></a>
- <span class="sourceLineNo">5079</span> * @param source the source point (in Java2D space).<a name="line.5079"></a>
- <span class="sourceLineNo">5080</span> * @param useAnchor use source point as zoom anchor?<a name="line.5080"></a>
- <span class="sourceLineNo">5081</span> *<a name="line.5081"></a>
- <span class="sourceLineNo">5082</span> * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5082"></a>
- <span class="sourceLineNo">5083</span> *<a name="line.5083"></a>
- <span class="sourceLineNo">5084</span> * @since 1.0.7<a name="line.5084"></a>
- <span class="sourceLineNo">5085</span> */<a name="line.5085"></a>
- <span class="sourceLineNo">5086</span> @Override<a name="line.5086"></a>
- <span class="sourceLineNo">5087</span> public void zoomDomainAxes(double factor, PlotRenderingInfo info,<a name="line.5087"></a>
- <span class="sourceLineNo">5088</span> Point2D source, boolean useAnchor) {<a name="line.5088"></a>
- <span class="sourceLineNo">5089</span><a name="line.5089"></a>
- <span class="sourceLineNo">5090</span> // perform the zoom on each domain axis<a name="line.5090"></a>
- <span class="sourceLineNo">5091</span> for (ValueAxis xAxis : this.domainAxes.values()) {<a name="line.5091"></a>
- <span class="sourceLineNo">5092</span> if (xAxis == null) {<a name="line.5092"></a>
- <span class="sourceLineNo">5093</span> continue;<a name="line.5093"></a>
- <span class="sourceLineNo">5094</span> }<a name="line.5094"></a>
- <span class="sourceLineNo">5095</span> if (useAnchor) {<a name="line.5095"></a>
- <span class="sourceLineNo">5096</span> // get the relevant source coordinate given the plot orientation<a name="line.5096"></a>
- <span class="sourceLineNo">5097</span> double sourceX = source.getX();<a name="line.5097"></a>
- <span class="sourceLineNo">5098</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.5098"></a>
- <span class="sourceLineNo">5099</span> sourceX = source.getY();<a name="line.5099"></a>
- <span class="sourceLineNo">5100</span> }<a name="line.5100"></a>
- <span class="sourceLineNo">5101</span> double anchorX = xAxis.java2DToValue(sourceX,<a name="line.5101"></a>
- <span class="sourceLineNo">5102</span> info.getDataArea(), getDomainAxisEdge());<a name="line.5102"></a>
- <span class="sourceLineNo">5103</span> xAxis.resizeRange2(factor, anchorX);<a name="line.5103"></a>
- <span class="sourceLineNo">5104</span> } else {<a name="line.5104"></a>
- <span class="sourceLineNo">5105</span> xAxis.resizeRange(factor);<a name="line.5105"></a>
- <span class="sourceLineNo">5106</span> }<a name="line.5106"></a>
- <span class="sourceLineNo">5107</span> }<a name="line.5107"></a>
- <span class="sourceLineNo">5108</span> }<a name="line.5108"></a>
- <span class="sourceLineNo">5109</span><a name="line.5109"></a>
- <span class="sourceLineNo">5110</span> /**<a name="line.5110"></a>
- <span class="sourceLineNo">5111</span> * Zooms in on the domain axis/axes. The new lower and upper bounds are<a name="line.5111"></a>
- <span class="sourceLineNo">5112</span> * specified as percentages of the current axis range, where 0 percent is<a name="line.5112"></a>
- <span class="sourceLineNo">5113</span> * the current lower bound and 100 percent is the current upper bound.<a name="line.5113"></a>
- <span class="sourceLineNo">5114</span> *<a name="line.5114"></a>
- <span class="sourceLineNo">5115</span> * @param lowerPercent a percentage that determines the new lower bound<a name="line.5115"></a>
- <span class="sourceLineNo">5116</span> * for the axis (e.g. 0.20 is twenty percent).<a name="line.5116"></a>
- <span class="sourceLineNo">5117</span> * @param upperPercent a percentage that determines the new upper bound<a name="line.5117"></a>
- <span class="sourceLineNo">5118</span> * for the axis (e.g. 0.80 is eighty percent).<a name="line.5118"></a>
- <span class="sourceLineNo">5119</span> * @param info the plot rendering info.<a name="line.5119"></a>
- <span class="sourceLineNo">5120</span> * @param source the source point (ignored).<a name="line.5120"></a>
- <span class="sourceLineNo">5121</span> *<a name="line.5121"></a>
- <span class="sourceLineNo">5122</span> * @see #zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)<a name="line.5122"></a>
- <span class="sourceLineNo">5123</span> */<a name="line.5123"></a>
- <span class="sourceLineNo">5124</span> @Override<a name="line.5124"></a>
- <span class="sourceLineNo">5125</span> public void zoomDomainAxes(double lowerPercent, double upperPercent,<a name="line.5125"></a>
- <span class="sourceLineNo">5126</span> PlotRenderingInfo info, Point2D source) {<a name="line.5126"></a>
- <span class="sourceLineNo">5127</span> for (ValueAxis xAxis : this.domainAxes.values()) {<a name="line.5127"></a>
- <span class="sourceLineNo">5128</span> if (xAxis != null) {<a name="line.5128"></a>
- <span class="sourceLineNo">5129</span> xAxis.zoomRange(lowerPercent, upperPercent);<a name="line.5129"></a>
- <span class="sourceLineNo">5130</span> }<a name="line.5130"></a>
- <span class="sourceLineNo">5131</span> }<a name="line.5131"></a>
- <span class="sourceLineNo">5132</span> }<a name="line.5132"></a>
- <span class="sourceLineNo">5133</span><a name="line.5133"></a>
- <span class="sourceLineNo">5134</span> /**<a name="line.5134"></a>
- <span class="sourceLineNo">5135</span> * Multiplies the range on the range axis/axes by the specified factor.<a name="line.5135"></a>
- <span class="sourceLineNo">5136</span> *<a name="line.5136"></a>
- <span class="sourceLineNo">5137</span> * @param factor the zoom factor.<a name="line.5137"></a>
- <span class="sourceLineNo">5138</span> * @param info the plot rendering info.<a name="line.5138"></a>
- <span class="sourceLineNo">5139</span> * @param source the source point.<a name="line.5139"></a>
- <span class="sourceLineNo">5140</span> *<a name="line.5140"></a>
- <span class="sourceLineNo">5141</span> * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5141"></a>
- <span class="sourceLineNo">5142</span> */<a name="line.5142"></a>
- <span class="sourceLineNo">5143</span> @Override<a name="line.5143"></a>
- <span class="sourceLineNo">5144</span> public void zoomRangeAxes(double factor, PlotRenderingInfo info,<a name="line.5144"></a>
- <span class="sourceLineNo">5145</span> Point2D source) {<a name="line.5145"></a>
- <span class="sourceLineNo">5146</span> // delegate to other method<a name="line.5146"></a>
- <span class="sourceLineNo">5147</span> zoomRangeAxes(factor, info, source, false);<a name="line.5147"></a>
- <span class="sourceLineNo">5148</span> }<a name="line.5148"></a>
- <span class="sourceLineNo">5149</span><a name="line.5149"></a>
- <span class="sourceLineNo">5150</span> /**<a name="line.5150"></a>
- <span class="sourceLineNo">5151</span> * Multiplies the range on the range axis/axes by the specified factor.<a name="line.5151"></a>
- <span class="sourceLineNo">5152</span> *<a name="line.5152"></a>
- <span class="sourceLineNo">5153</span> * @param factor the zoom factor.<a name="line.5153"></a>
- <span class="sourceLineNo">5154</span> * @param info the plot rendering info.<a name="line.5154"></a>
- <span class="sourceLineNo">5155</span> * @param source the source point.<a name="line.5155"></a>
- <span class="sourceLineNo">5156</span> * @param useAnchor a flag that controls whether or not the source point<a name="line.5156"></a>
- <span class="sourceLineNo">5157</span> * is used for the zoom anchor.<a name="line.5157"></a>
- <span class="sourceLineNo">5158</span> *<a name="line.5158"></a>
- <span class="sourceLineNo">5159</span> * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5159"></a>
- <span class="sourceLineNo">5160</span> *<a name="line.5160"></a>
- <span class="sourceLineNo">5161</span> * @since 1.0.7<a name="line.5161"></a>
- <span class="sourceLineNo">5162</span> */<a name="line.5162"></a>
- <span class="sourceLineNo">5163</span> @Override<a name="line.5163"></a>
- <span class="sourceLineNo">5164</span> public void zoomRangeAxes(double factor, PlotRenderingInfo info,<a name="line.5164"></a>
- <span class="sourceLineNo">5165</span> Point2D source, boolean useAnchor) {<a name="line.5165"></a>
- <span class="sourceLineNo">5166</span><a name="line.5166"></a>
- <span class="sourceLineNo">5167</span> // perform the zoom on each range axis<a name="line.5167"></a>
- <span class="sourceLineNo">5168</span> for (ValueAxis yAxis : this.rangeAxes.values()) {<a name="line.5168"></a>
- <span class="sourceLineNo">5169</span> if (yAxis == null) {<a name="line.5169"></a>
- <span class="sourceLineNo">5170</span> continue;<a name="line.5170"></a>
- <span class="sourceLineNo">5171</span> }<a name="line.5171"></a>
- <span class="sourceLineNo">5172</span> if (useAnchor) {<a name="line.5172"></a>
- <span class="sourceLineNo">5173</span> // get the relevant source coordinate given the plot orientation<a name="line.5173"></a>
- <span class="sourceLineNo">5174</span> double sourceY = source.getY();<a name="line.5174"></a>
- <span class="sourceLineNo">5175</span> if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.5175"></a>
- <span class="sourceLineNo">5176</span> sourceY = source.getX();<a name="line.5176"></a>
- <span class="sourceLineNo">5177</span> }<a name="line.5177"></a>
- <span class="sourceLineNo">5178</span> double anchorY = yAxis.java2DToValue(sourceY,<a name="line.5178"></a>
- <span class="sourceLineNo">5179</span> info.getDataArea(), getRangeAxisEdge());<a name="line.5179"></a>
- <span class="sourceLineNo">5180</span> yAxis.resizeRange2(factor, anchorY);<a name="line.5180"></a>
- <span class="sourceLineNo">5181</span> } else {<a name="line.5181"></a>
- <span class="sourceLineNo">5182</span> yAxis.resizeRange(factor);<a name="line.5182"></a>
- <span class="sourceLineNo">5183</span> }<a name="line.5183"></a>
- <span class="sourceLineNo">5184</span> }<a name="line.5184"></a>
- <span class="sourceLineNo">5185</span> }<a name="line.5185"></a>
- <span class="sourceLineNo">5186</span><a name="line.5186"></a>
- <span class="sourceLineNo">5187</span> /**<a name="line.5187"></a>
- <span class="sourceLineNo">5188</span> * Zooms in on the range axes.<a name="line.5188"></a>
- <span class="sourceLineNo">5189</span> *<a name="line.5189"></a>
- <span class="sourceLineNo">5190</span> * @param lowerPercent the lower bound.<a name="line.5190"></a>
- <span class="sourceLineNo">5191</span> * @param upperPercent the upper bound.<a name="line.5191"></a>
- <span class="sourceLineNo">5192</span> * @param info the plot rendering info.<a name="line.5192"></a>
- <span class="sourceLineNo">5193</span> * @param source the source point.<a name="line.5193"></a>
- <span class="sourceLineNo">5194</span> *<a name="line.5194"></a>
- <span class="sourceLineNo">5195</span> * @see #zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)<a name="line.5195"></a>
- <span class="sourceLineNo">5196</span> */<a name="line.5196"></a>
- <span class="sourceLineNo">5197</span> @Override<a name="line.5197"></a>
- <span class="sourceLineNo">5198</span> public void zoomRangeAxes(double lowerPercent, double upperPercent,<a name="line.5198"></a>
- <span class="sourceLineNo">5199</span> PlotRenderingInfo info, Point2D source) {<a name="line.5199"></a>
- <span class="sourceLineNo">5200</span> for (ValueAxis yAxis : this.rangeAxes.values()) {<a name="line.5200"></a>
- <span class="sourceLineNo">5201</span> if (yAxis != null) {<a name="line.5201"></a>
- <span class="sourceLineNo">5202</span> yAxis.zoomRange(lowerPercent, upperPercent);<a name="line.5202"></a>
- <span class="sourceLineNo">5203</span> }<a name="line.5203"></a>
- <span class="sourceLineNo">5204</span> }<a name="line.5204"></a>
- <span class="sourceLineNo">5205</span> }<a name="line.5205"></a>
- <span class="sourceLineNo">5206</span><a name="line.5206"></a>
- <span class="sourceLineNo">5207</span> /**<a name="line.5207"></a>
- <span class="sourceLineNo">5208</span> * Returns <code>true</code>, indicating that the domain axis/axes for this<a name="line.5208"></a>
- <span class="sourceLineNo">5209</span> * plot are zoomable.<a name="line.5209"></a>
- <span class="sourceLineNo">5210</span> *<a name="line.5210"></a>
- <span class="sourceLineNo">5211</span> * @return A boolean.<a name="line.5211"></a>
- <span class="sourceLineNo">5212</span> *<a name="line.5212"></a>
- <span class="sourceLineNo">5213</span> * @see #isRangeZoomable()<a name="line.5213"></a>
- <span class="sourceLineNo">5214</span> */<a name="line.5214"></a>
- <span class="sourceLineNo">5215</span> @Override<a name="line.5215"></a>
- <span class="sourceLineNo">5216</span> public boolean isDomainZoomable() {<a name="line.5216"></a>
- <span class="sourceLineNo">5217</span> return true;<a name="line.5217"></a>
- <span class="sourceLineNo">5218</span> }<a name="line.5218"></a>
- <span class="sourceLineNo">5219</span><a name="line.5219"></a>
- <span class="sourceLineNo">5220</span> /**<a name="line.5220"></a>
- <span class="sourceLineNo">5221</span> * Returns <code>true</code>, indicating that the range axis/axes for this<a name="line.5221"></a>
- <span class="sourceLineNo">5222</span> * plot are zoomable.<a name="line.5222"></a>
- <span class="sourceLineNo">5223</span> *<a name="line.5223"></a>
- <span class="sourceLineNo">5224</span> * @return A boolean.<a name="line.5224"></a>
- <span class="sourceLineNo">5225</span> *<a name="line.5225"></a>
- <span class="sourceLineNo">5226</span> * @see #isDomainZoomable()<a name="line.5226"></a>
- <span class="sourceLineNo">5227</span> */<a name="line.5227"></a>
- <span class="sourceLineNo">5228</span> @Override<a name="line.5228"></a>
- <span class="sourceLineNo">5229</span> public boolean isRangeZoomable() {<a name="line.5229"></a>
- <span class="sourceLineNo">5230</span> return true;<a name="line.5230"></a>
- <span class="sourceLineNo">5231</span> }<a name="line.5231"></a>
- <span class="sourceLineNo">5232</span><a name="line.5232"></a>
- <span class="sourceLineNo">5233</span> /**<a name="line.5233"></a>
- <span class="sourceLineNo">5234</span> * Returns the number of series in the primary dataset for this plot. If<a name="line.5234"></a>
- <span class="sourceLineNo">5235</span> * the dataset is <code>null</code>, the method returns 0.<a name="line.5235"></a>
- <span class="sourceLineNo">5236</span> *<a name="line.5236"></a>
- <span class="sourceLineNo">5237</span> * @return The series count.<a name="line.5237"></a>
- <span class="sourceLineNo">5238</span> */<a name="line.5238"></a>
- <span class="sourceLineNo">5239</span> public int getSeriesCount() {<a name="line.5239"></a>
- <span class="sourceLineNo">5240</span> int result = 0;<a name="line.5240"></a>
- <span class="sourceLineNo">5241</span> XYDataset dataset = getDataset();<a name="line.5241"></a>
- <span class="sourceLineNo">5242</span> if (dataset != null) {<a name="line.5242"></a>
- <span class="sourceLineNo">5243</span> result = dataset.getSeriesCount();<a name="line.5243"></a>
- <span class="sourceLineNo">5244</span> }<a name="line.5244"></a>
- <span class="sourceLineNo">5245</span> return result;<a name="line.5245"></a>
- <span class="sourceLineNo">5246</span> }<a name="line.5246"></a>
- <span class="sourceLineNo">5247</span><a name="line.5247"></a>
- <span class="sourceLineNo">5248</span> /**<a name="line.5248"></a>
- <span class="sourceLineNo">5249</span> * Returns the fixed legend items, if any.<a name="line.5249"></a>
- <span class="sourceLineNo">5250</span> *<a name="line.5250"></a>
- <span class="sourceLineNo">5251</span> * @return The legend items (possibly <code>null</code>).<a name="line.5251"></a>
- <span class="sourceLineNo">5252</span> *<a name="line.5252"></a>
- <span class="sourceLineNo">5253</span> * @see #setFixedLegendItems(LegendItemCollection)<a name="line.5253"></a>
- <span class="sourceLineNo">5254</span> */<a name="line.5254"></a>
- <span class="sourceLineNo">5255</span> public LegendItemCollection getFixedLegendItems() {<a name="line.5255"></a>
- <span class="sourceLineNo">5256</span> return this.fixedLegendItems;<a name="line.5256"></a>
- <span class="sourceLineNo">5257</span> }<a name="line.5257"></a>
- <span class="sourceLineNo">5258</span><a name="line.5258"></a>
- <span class="sourceLineNo">5259</span> /**<a name="line.5259"></a>
- <span class="sourceLineNo">5260</span> * Sets the fixed legend items for the plot. Leave this set to<a name="line.5260"></a>
- <span class="sourceLineNo">5261</span> * <code>null</code> if you prefer the legend items to be created<a name="line.5261"></a>
- <span class="sourceLineNo">5262</span> * automatically.<a name="line.5262"></a>
- <span class="sourceLineNo">5263</span> *<a name="line.5263"></a>
- <span class="sourceLineNo">5264</span> * @param items the legend items (<code>null</code> permitted).<a name="line.5264"></a>
- <span class="sourceLineNo">5265</span> *<a name="line.5265"></a>
- <span class="sourceLineNo">5266</span> * @see #getFixedLegendItems()<a name="line.5266"></a>
- <span class="sourceLineNo">5267</span> */<a name="line.5267"></a>
- <span class="sourceLineNo">5268</span> public void setFixedLegendItems(LegendItemCollection items) {<a name="line.5268"></a>
- <span class="sourceLineNo">5269</span> this.fixedLegendItems = items;<a name="line.5269"></a>
- <span class="sourceLineNo">5270</span> fireChangeEvent();<a name="line.5270"></a>
- <span class="sourceLineNo">5271</span> }<a name="line.5271"></a>
- <span class="sourceLineNo">5272</span><a name="line.5272"></a>
- <span class="sourceLineNo">5273</span> /**<a name="line.5273"></a>
- <span class="sourceLineNo">5274</span> * Returns the legend items for the plot. Each legend item is generated by<a name="line.5274"></a>
- <span class="sourceLineNo">5275</span> * the plot's renderer, since the renderer is responsible for the visual<a name="line.5275"></a>
- <span class="sourceLineNo">5276</span> * representation of the data.<a name="line.5276"></a>
- <span class="sourceLineNo">5277</span> *<a name="line.5277"></a>
- <span class="sourceLineNo">5278</span> * @return The legend items.<a name="line.5278"></a>
- <span class="sourceLineNo">5279</span> */<a name="line.5279"></a>
- <span class="sourceLineNo">5280</span> @Override<a name="line.5280"></a>
- <span class="sourceLineNo">5281</span> public LegendItemCollection getLegendItems() {<a name="line.5281"></a>
- <span class="sourceLineNo">5282</span> if (this.fixedLegendItems != null) {<a name="line.5282"></a>
- <span class="sourceLineNo">5283</span> return this.fixedLegendItems;<a name="line.5283"></a>
- <span class="sourceLineNo">5284</span> }<a name="line.5284"></a>
- <span class="sourceLineNo">5285</span> LegendItemCollection result = new LegendItemCollection();<a name="line.5285"></a>
- <span class="sourceLineNo">5286</span> for (XYDataset dataset : this.datasets.values()) {<a name="line.5286"></a>
- <span class="sourceLineNo">5287</span> if (dataset == null) {<a name="line.5287"></a>
- <span class="sourceLineNo">5288</span> continue;<a name="line.5288"></a>
- <span class="sourceLineNo">5289</span> }<a name="line.5289"></a>
- <span class="sourceLineNo">5290</span> int datasetIndex = indexOf(dataset);<a name="line.5290"></a>
- <span class="sourceLineNo">5291</span> XYItemRenderer renderer = getRenderer(datasetIndex);<a name="line.5291"></a>
- <span class="sourceLineNo">5292</span> if (renderer == null) {<a name="line.5292"></a>
- <span class="sourceLineNo">5293</span> renderer = getRenderer(0);<a name="line.5293"></a>
- <span class="sourceLineNo">5294</span> }<a name="line.5294"></a>
- <span class="sourceLineNo">5295</span> if (renderer != null) {<a name="line.5295"></a>
- <span class="sourceLineNo">5296</span> int seriesCount = dataset.getSeriesCount();<a name="line.5296"></a>
- <span class="sourceLineNo">5297</span> for (int i = 0; i < seriesCount; i++) {<a name="line.5297"></a>
- <span class="sourceLineNo">5298</span> if (renderer.isSeriesVisible(i)<a name="line.5298"></a>
- <span class="sourceLineNo">5299</span> && renderer.isSeriesVisibleInLegend(i)) {<a name="line.5299"></a>
- <span class="sourceLineNo">5300</span> LegendItem item = renderer.getLegendItem(<a name="line.5300"></a>
- <span class="sourceLineNo">5301</span> datasetIndex, i);<a name="line.5301"></a>
- <span class="sourceLineNo">5302</span> if (item != null) {<a name="line.5302"></a>
- <span class="sourceLineNo">5303</span> result.add(item);<a name="line.5303"></a>
- <span class="sourceLineNo">5304</span> }<a name="line.5304"></a>
- <span class="sourceLineNo">5305</span> }<a name="line.5305"></a>
- <span class="sourceLineNo">5306</span> }<a name="line.5306"></a>
- <span class="sourceLineNo">5307</span> }<a name="line.5307"></a>
- <span class="sourceLineNo">5308</span> }<a name="line.5308"></a>
- <span class="sourceLineNo">5309</span> return result;<a name="line.5309"></a>
- <span class="sourceLineNo">5310</span> }<a name="line.5310"></a>
- <span class="sourceLineNo">5311</span><a name="line.5311"></a>
- <span class="sourceLineNo">5312</span> /**<a name="line.5312"></a>
- <span class="sourceLineNo">5313</span> * Tests this plot for equality with another object.<a name="line.5313"></a>
- <span class="sourceLineNo">5314</span> *<a name="line.5314"></a>
- <span class="sourceLineNo">5315</span> * @param obj the object (<code>null</code> permitted).<a name="line.5315"></a>
- <span class="sourceLineNo">5316</span> *<a name="line.5316"></a>
- <span class="sourceLineNo">5317</span> * @return <code>true</code> or <code>false</code>.<a name="line.5317"></a>
- <span class="sourceLineNo">5318</span> */<a name="line.5318"></a>
- <span class="sourceLineNo">5319</span> @Override<a name="line.5319"></a>
- <span class="sourceLineNo">5320</span> public boolean equals(Object obj) {<a name="line.5320"></a>
- <span class="sourceLineNo">5321</span> if (obj == this) {<a name="line.5321"></a>
- <span class="sourceLineNo">5322</span> return true;<a name="line.5322"></a>
- <span class="sourceLineNo">5323</span> }<a name="line.5323"></a>
- <span class="sourceLineNo">5324</span> if (!(obj instanceof XYPlot)) {<a name="line.5324"></a>
- <span class="sourceLineNo">5325</span> return false;<a name="line.5325"></a>
- <span class="sourceLineNo">5326</span> }<a name="line.5326"></a>
- <span class="sourceLineNo">5327</span> XYPlot that = (XYPlot) obj;<a name="line.5327"></a>
- <span class="sourceLineNo">5328</span> if (this.weight != that.weight) {<a name="line.5328"></a>
- <span class="sourceLineNo">5329</span> return false;<a name="line.5329"></a>
- <span class="sourceLineNo">5330</span> }<a name="line.5330"></a>
- <span class="sourceLineNo">5331</span> if (this.orientation != that.orientation) {<a name="line.5331"></a>
- <span class="sourceLineNo">5332</span> return false;<a name="line.5332"></a>
- <span class="sourceLineNo">5333</span> }<a name="line.5333"></a>
- <span class="sourceLineNo">5334</span> if (!this.domainAxes.equals(that.domainAxes)) {<a name="line.5334"></a>
- <span class="sourceLineNo">5335</span> return false;<a name="line.5335"></a>
- <span class="sourceLineNo">5336</span> }<a name="line.5336"></a>
- <span class="sourceLineNo">5337</span> if (!this.domainAxisLocations.equals(that.domainAxisLocations)) {<a name="line.5337"></a>
- <span class="sourceLineNo">5338</span> return false;<a name="line.5338"></a>
- <span class="sourceLineNo">5339</span> }<a name="line.5339"></a>
- <span class="sourceLineNo">5340</span> if (this.rangeCrosshairLockedOnData<a name="line.5340"></a>
- <span class="sourceLineNo">5341</span> != that.rangeCrosshairLockedOnData) {<a name="line.5341"></a>
- <span class="sourceLineNo">5342</span> return false;<a name="line.5342"></a>
- <span class="sourceLineNo">5343</span> }<a name="line.5343"></a>
- <span class="sourceLineNo">5344</span> if (this.domainGridlinesVisible != that.domainGridlinesVisible) {<a name="line.5344"></a>
- <span class="sourceLineNo">5345</span> return false;<a name="line.5345"></a>
- <span class="sourceLineNo">5346</span> }<a name="line.5346"></a>
- <span class="sourceLineNo">5347</span> if (this.rangeGridlinesVisible != that.rangeGridlinesVisible) {<a name="line.5347"></a>
- <span class="sourceLineNo">5348</span> return false;<a name="line.5348"></a>
- <span class="sourceLineNo">5349</span> }<a name="line.5349"></a>
- <span class="sourceLineNo">5350</span> if (this.domainMinorGridlinesVisible<a name="line.5350"></a>
- <span class="sourceLineNo">5351</span> != that.domainMinorGridlinesVisible) {<a name="line.5351"></a>
- <span class="sourceLineNo">5352</span> return false;<a name="line.5352"></a>
- <span class="sourceLineNo">5353</span> }<a name="line.5353"></a>
- <span class="sourceLineNo">5354</span> if (this.rangeMinorGridlinesVisible<a name="line.5354"></a>
- <span class="sourceLineNo">5355</span> != that.rangeMinorGridlinesVisible) {<a name="line.5355"></a>
- <span class="sourceLineNo">5356</span> return false;<a name="line.5356"></a>
- <span class="sourceLineNo">5357</span> }<a name="line.5357"></a>
- <span class="sourceLineNo">5358</span> if (this.domainZeroBaselineVisible != that.domainZeroBaselineVisible) {<a name="line.5358"></a>
- <span class="sourceLineNo">5359</span> return false;<a name="line.5359"></a>
- <span class="sourceLineNo">5360</span> }<a name="line.5360"></a>
- <span class="sourceLineNo">5361</span> if (this.rangeZeroBaselineVisible != that.rangeZeroBaselineVisible) {<a name="line.5361"></a>
- <span class="sourceLineNo">5362</span> return false;<a name="line.5362"></a>
- <span class="sourceLineNo">5363</span> }<a name="line.5363"></a>
- <span class="sourceLineNo">5364</span> if (this.domainCrosshairVisible != that.domainCrosshairVisible) {<a name="line.5364"></a>
- <span class="sourceLineNo">5365</span> return false;<a name="line.5365"></a>
- <span class="sourceLineNo">5366</span> }<a name="line.5366"></a>
- <span class="sourceLineNo">5367</span> if (this.domainCrosshairValue != that.domainCrosshairValue) {<a name="line.5367"></a>
- <span class="sourceLineNo">5368</span> return false;<a name="line.5368"></a>
- <span class="sourceLineNo">5369</span> }<a name="line.5369"></a>
- <span class="sourceLineNo">5370</span> if (this.domainCrosshairLockedOnData<a name="line.5370"></a>
- <span class="sourceLineNo">5371</span> != that.domainCrosshairLockedOnData) {<a name="line.5371"></a>
- <span class="sourceLineNo">5372</span> return false;<a name="line.5372"></a>
- <span class="sourceLineNo">5373</span> }<a name="line.5373"></a>
- <span class="sourceLineNo">5374</span> if (this.rangeCrosshairVisible != that.rangeCrosshairVisible) {<a name="line.5374"></a>
- <span class="sourceLineNo">5375</span> return false;<a name="line.5375"></a>
- <span class="sourceLineNo">5376</span> }<a name="line.5376"></a>
- <span class="sourceLineNo">5377</span> if (this.rangeCrosshairValue != that.rangeCrosshairValue) {<a name="line.5377"></a>
- <span class="sourceLineNo">5378</span> return false;<a name="line.5378"></a>
- <span class="sourceLineNo">5379</span> }<a name="line.5379"></a>
- <span class="sourceLineNo">5380</span> if (!ObjectUtilities.equal(this.axisOffset, that.axisOffset)) {<a name="line.5380"></a>
- <span class="sourceLineNo">5381</span> return false;<a name="line.5381"></a>
- <span class="sourceLineNo">5382</span> }<a name="line.5382"></a>
- <span class="sourceLineNo">5383</span> if (!ObjectUtilities.equal(this.renderers, that.renderers)) {<a name="line.5383"></a>
- <span class="sourceLineNo">5384</span> return false;<a name="line.5384"></a>
- <span class="sourceLineNo">5385</span> }<a name="line.5385"></a>
- <span class="sourceLineNo">5386</span> if (!ObjectUtilities.equal(this.rangeAxes, that.rangeAxes)) {<a name="line.5386"></a>
- <span class="sourceLineNo">5387</span> return false;<a name="line.5387"></a>
- <span class="sourceLineNo">5388</span> }<a name="line.5388"></a>
- <span class="sourceLineNo">5389</span> if (!this.rangeAxisLocations.equals(that.rangeAxisLocations)) {<a name="line.5389"></a>
- <span class="sourceLineNo">5390</span> return false;<a name="line.5390"></a>
- <span class="sourceLineNo">5391</span> }<a name="line.5391"></a>
- <span class="sourceLineNo">5392</span> if (!ObjectUtilities.equal(this.datasetToDomainAxesMap,<a name="line.5392"></a>
- <span class="sourceLineNo">5393</span> that.datasetToDomainAxesMap)) {<a name="line.5393"></a>
- <span class="sourceLineNo">5394</span> return false;<a name="line.5394"></a>
- <span class="sourceLineNo">5395</span> }<a name="line.5395"></a>
- <span class="sourceLineNo">5396</span> if (!ObjectUtilities.equal(this.datasetToRangeAxesMap,<a name="line.5396"></a>
- <span class="sourceLineNo">5397</span> that.datasetToRangeAxesMap)) {<a name="line.5397"></a>
- <span class="sourceLineNo">5398</span> return false;<a name="line.5398"></a>
- <span class="sourceLineNo">5399</span> }<a name="line.5399"></a>
- <span class="sourceLineNo">5400</span> if (!ObjectUtilities.equal(this.domainGridlineStroke,<a name="line.5400"></a>
- <span class="sourceLineNo">5401</span> that.domainGridlineStroke)) {<a name="line.5401"></a>
- <span class="sourceLineNo">5402</span> return false;<a name="line.5402"></a>
- <span class="sourceLineNo">5403</span> }<a name="line.5403"></a>
- <span class="sourceLineNo">5404</span> if (!PaintUtilities.equal(this.domainGridlinePaint,<a name="line.5404"></a>
- <span class="sourceLineNo">5405</span> that.domainGridlinePaint)) {<a name="line.5405"></a>
- <span class="sourceLineNo">5406</span> return false;<a name="line.5406"></a>
- <span class="sourceLineNo">5407</span> }<a name="line.5407"></a>
- <span class="sourceLineNo">5408</span> if (!ObjectUtilities.equal(this.rangeGridlineStroke,<a name="line.5408"></a>
- <span class="sourceLineNo">5409</span> that.rangeGridlineStroke)) {<a name="line.5409"></a>
- <span class="sourceLineNo">5410</span> return false;<a name="line.5410"></a>
- <span class="sourceLineNo">5411</span> }<a name="line.5411"></a>
- <span class="sourceLineNo">5412</span> if (!PaintUtilities.equal(this.rangeGridlinePaint,<a name="line.5412"></a>
- <span class="sourceLineNo">5413</span> that.rangeGridlinePaint)) {<a name="line.5413"></a>
- <span class="sourceLineNo">5414</span> return false;<a name="line.5414"></a>
- <span class="sourceLineNo">5415</span> }<a name="line.5415"></a>
- <span class="sourceLineNo">5416</span> if (!ObjectUtilities.equal(this.domainMinorGridlineStroke,<a name="line.5416"></a>
- <span class="sourceLineNo">5417</span> that.domainMinorGridlineStroke)) {<a name="line.5417"></a>
- <span class="sourceLineNo">5418</span> return false;<a name="line.5418"></a>
- <span class="sourceLineNo">5419</span> }<a name="line.5419"></a>
- <span class="sourceLineNo">5420</span> if (!PaintUtilities.equal(this.domainMinorGridlinePaint,<a name="line.5420"></a>
- <span class="sourceLineNo">5421</span> that.domainMinorGridlinePaint)) {<a name="line.5421"></a>
- <span class="sourceLineNo">5422</span> return false;<a name="line.5422"></a>
- <span class="sourceLineNo">5423</span> }<a name="line.5423"></a>
- <span class="sourceLineNo">5424</span> if (!ObjectUtilities.equal(this.rangeMinorGridlineStroke,<a name="line.5424"></a>
- <span class="sourceLineNo">5425</span> that.rangeMinorGridlineStroke)) {<a name="line.5425"></a>
- <span class="sourceLineNo">5426</span> return false;<a name="line.5426"></a>
- <span class="sourceLineNo">5427</span> }<a name="line.5427"></a>
- <span class="sourceLineNo">5428</span> if (!PaintUtilities.equal(this.rangeMinorGridlinePaint,<a name="line.5428"></a>
- <span class="sourceLineNo">5429</span> that.rangeMinorGridlinePaint)) {<a name="line.5429"></a>
- <span class="sourceLineNo">5430</span> return false;<a name="line.5430"></a>
- <span class="sourceLineNo">5431</span> }<a name="line.5431"></a>
- <span class="sourceLineNo">5432</span> if (!PaintUtilities.equal(this.domainZeroBaselinePaint,<a name="line.5432"></a>
- <span class="sourceLineNo">5433</span> that.domainZeroBaselinePaint)) {<a name="line.5433"></a>
- <span class="sourceLineNo">5434</span> return false;<a name="line.5434"></a>
- <span class="sourceLineNo">5435</span> }<a name="line.5435"></a>
- <span class="sourceLineNo">5436</span> if (!ObjectUtilities.equal(this.domainZeroBaselineStroke,<a name="line.5436"></a>
- <span class="sourceLineNo">5437</span> that.domainZeroBaselineStroke)) {<a name="line.5437"></a>
- <span class="sourceLineNo">5438</span> return false;<a name="line.5438"></a>
- <span class="sourceLineNo">5439</span> }<a name="line.5439"></a>
- <span class="sourceLineNo">5440</span> if (!PaintUtilities.equal(this.rangeZeroBaselinePaint,<a name="line.5440"></a>
- <span class="sourceLineNo">5441</span> that.rangeZeroBaselinePaint)) {<a name="line.5441"></a>
- <span class="sourceLineNo">5442</span> return false;<a name="line.5442"></a>
- <span class="sourceLineNo">5443</span> }<a name="line.5443"></a>
- <span class="sourceLineNo">5444</span> if (!ObjectUtilities.equal(this.rangeZeroBaselineStroke,<a name="line.5444"></a>
- <span class="sourceLineNo">5445</span> that.rangeZeroBaselineStroke)) {<a name="line.5445"></a>
- <span class="sourceLineNo">5446</span> return false;<a name="line.5446"></a>
- <span class="sourceLineNo">5447</span> }<a name="line.5447"></a>
- <span class="sourceLineNo">5448</span> if (!ObjectUtilities.equal(this.domainCrosshairStroke,<a name="line.5448"></a>
- <span class="sourceLineNo">5449</span> that.domainCrosshairStroke)) {<a name="line.5449"></a>
- <span class="sourceLineNo">5450</span> return false;<a name="line.5450"></a>
- <span class="sourceLineNo">5451</span> }<a name="line.5451"></a>
- <span class="sourceLineNo">5452</span> if (!PaintUtilities.equal(this.domainCrosshairPaint,<a name="line.5452"></a>
- <span class="sourceLineNo">5453</span> that.domainCrosshairPaint)) {<a name="line.5453"></a>
- <span class="sourceLineNo">5454</span> return false;<a name="line.5454"></a>
- <span class="sourceLineNo">5455</span> }<a name="line.5455"></a>
- <span class="sourceLineNo">5456</span> if (!ObjectUtilities.equal(this.rangeCrosshairStroke,<a name="line.5456"></a>
- <span class="sourceLineNo">5457</span> that.rangeCrosshairStroke)) {<a name="line.5457"></a>
- <span class="sourceLineNo">5458</span> return false;<a name="line.5458"></a>
- <span class="sourceLineNo">5459</span> }<a name="line.5459"></a>
- <span class="sourceLineNo">5460</span> if (!PaintUtilities.equal(this.rangeCrosshairPaint,<a name="line.5460"></a>
- <span class="sourceLineNo">5461</span> that.rangeCrosshairPaint)) {<a name="line.5461"></a>
- <span class="sourceLineNo">5462</span> return false;<a name="line.5462"></a>
- <span class="sourceLineNo">5463</span> }<a name="line.5463"></a>
- <span class="sourceLineNo">5464</span> if (!ObjectUtilities.equal(this.foregroundDomainMarkers,<a name="line.5464"></a>
- <span class="sourceLineNo">5465</span> that.foregroundDomainMarkers)) {<a name="line.5465"></a>
- <span class="sourceLineNo">5466</span> return false;<a name="line.5466"></a>
- <span class="sourceLineNo">5467</span> }<a name="line.5467"></a>
- <span class="sourceLineNo">5468</span> if (!ObjectUtilities.equal(this.backgroundDomainMarkers,<a name="line.5468"></a>
- <span class="sourceLineNo">5469</span> that.backgroundDomainMarkers)) {<a name="line.5469"></a>
- <span class="sourceLineNo">5470</span> return false;<a name="line.5470"></a>
- <span class="sourceLineNo">5471</span> }<a name="line.5471"></a>
- <span class="sourceLineNo">5472</span> if (!ObjectUtilities.equal(this.foregroundRangeMarkers,<a name="line.5472"></a>
- <span class="sourceLineNo">5473</span> that.foregroundRangeMarkers)) {<a name="line.5473"></a>
- <span class="sourceLineNo">5474</span> return false;<a name="line.5474"></a>
- <span class="sourceLineNo">5475</span> }<a name="line.5475"></a>
- <span class="sourceLineNo">5476</span> if (!ObjectUtilities.equal(this.backgroundRangeMarkers,<a name="line.5476"></a>
- <span class="sourceLineNo">5477</span> that.backgroundRangeMarkers)) {<a name="line.5477"></a>
- <span class="sourceLineNo">5478</span> return false;<a name="line.5478"></a>
- <span class="sourceLineNo">5479</span> }<a name="line.5479"></a>
- <span class="sourceLineNo">5480</span> if (!ObjectUtilities.equal(this.foregroundDomainMarkers,<a name="line.5480"></a>
- <span class="sourceLineNo">5481</span> that.foregroundDomainMarkers)) {<a name="line.5481"></a>
- <span class="sourceLineNo">5482</span> return false;<a name="line.5482"></a>
- <span class="sourceLineNo">5483</span> }<a name="line.5483"></a>
- <span class="sourceLineNo">5484</span> if (!ObjectUtilities.equal(this.backgroundDomainMarkers,<a name="line.5484"></a>
- <span class="sourceLineNo">5485</span> that.backgroundDomainMarkers)) {<a name="line.5485"></a>
- <span class="sourceLineNo">5486</span> return false;<a name="line.5486"></a>
- <span class="sourceLineNo">5487</span> }<a name="line.5487"></a>
- <span class="sourceLineNo">5488</span> if (!ObjectUtilities.equal(this.foregroundRangeMarkers,<a name="line.5488"></a>
- <span class="sourceLineNo">5489</span> that.foregroundRangeMarkers)) {<a name="line.5489"></a>
- <span class="sourceLineNo">5490</span> return false;<a name="line.5490"></a>
- <span class="sourceLineNo">5491</span> }<a name="line.5491"></a>
- <span class="sourceLineNo">5492</span> if (!ObjectUtilities.equal(this.backgroundRangeMarkers,<a name="line.5492"></a>
- <span class="sourceLineNo">5493</span> that.backgroundRangeMarkers)) {<a name="line.5493"></a>
- <span class="sourceLineNo">5494</span> return false;<a name="line.5494"></a>
- <span class="sourceLineNo">5495</span> }<a name="line.5495"></a>
- <span class="sourceLineNo">5496</span> if (!ObjectUtilities.equal(this.annotations, that.annotations)) {<a name="line.5496"></a>
- <span class="sourceLineNo">5497</span> return false;<a name="line.5497"></a>
- <span class="sourceLineNo">5498</span> }<a name="line.5498"></a>
- <span class="sourceLineNo">5499</span> if (!ObjectUtilities.equal(this.fixedLegendItems,<a name="line.5499"></a>
- <span class="sourceLineNo">5500</span> that.fixedLegendItems)) {<a name="line.5500"></a>
- <span class="sourceLineNo">5501</span> return false;<a name="line.5501"></a>
- <span class="sourceLineNo">5502</span> }<a name="line.5502"></a>
- <span class="sourceLineNo">5503</span> if (!PaintUtilities.equal(this.domainTickBandPaint,<a name="line.5503"></a>
- <span class="sourceLineNo">5504</span> that.domainTickBandPaint)) {<a name="line.5504"></a>
- <span class="sourceLineNo">5505</span> return false;<a name="line.5505"></a>
- <span class="sourceLineNo">5506</span> }<a name="line.5506"></a>
- <span class="sourceLineNo">5507</span> if (!PaintUtilities.equal(this.rangeTickBandPaint,<a name="line.5507"></a>
- <span class="sourceLineNo">5508</span> that.rangeTickBandPaint)) {<a name="line.5508"></a>
- <span class="sourceLineNo">5509</span> return false;<a name="line.5509"></a>
- <span class="sourceLineNo">5510</span> }<a name="line.5510"></a>
- <span class="sourceLineNo">5511</span> if (!this.quadrantOrigin.equals(that.quadrantOrigin)) {<a name="line.5511"></a>
- <span class="sourceLineNo">5512</span> return false;<a name="line.5512"></a>
- <span class="sourceLineNo">5513</span> }<a name="line.5513"></a>
- <span class="sourceLineNo">5514</span> for (int i = 0; i < 4; i++) {<a name="line.5514"></a>
- <span class="sourceLineNo">5515</span> if (!PaintUtilities.equal(this.quadrantPaint[i],<a name="line.5515"></a>
- <span class="sourceLineNo">5516</span> that.quadrantPaint[i])) {<a name="line.5516"></a>
- <span class="sourceLineNo">5517</span> return false;<a name="line.5517"></a>
- <span class="sourceLineNo">5518</span> }<a name="line.5518"></a>
- <span class="sourceLineNo">5519</span> }<a name="line.5519"></a>
- <span class="sourceLineNo">5520</span> if (!ObjectUtilities.equal(this.shadowGenerator,<a name="line.5520"></a>
- <span class="sourceLineNo">5521</span> that.shadowGenerator)) {<a name="line.5521"></a>
- <span class="sourceLineNo">5522</span> return false;<a name="line.5522"></a>
- <span class="sourceLineNo">5523</span> }<a name="line.5523"></a>
- <span class="sourceLineNo">5524</span> return super.equals(obj);<a name="line.5524"></a>
- <span class="sourceLineNo">5525</span> }<a name="line.5525"></a>
- <span class="sourceLineNo">5526</span><a name="line.5526"></a>
- <span class="sourceLineNo">5527</span> /**<a name="line.5527"></a>
- <span class="sourceLineNo">5528</span> * Returns a clone of the plot.<a name="line.5528"></a>
- <span class="sourceLineNo">5529</span> *<a name="line.5529"></a>
- <span class="sourceLineNo">5530</span> * @return A clone.<a name="line.5530"></a>
- <span class="sourceLineNo">5531</span> *<a name="line.5531"></a>
- <span class="sourceLineNo">5532</span> * @throws CloneNotSupportedException this can occur if some component of<a name="line.5532"></a>
- <span class="sourceLineNo">5533</span> * the plot cannot be cloned.<a name="line.5533"></a>
- <span class="sourceLineNo">5534</span> */<a name="line.5534"></a>
- <span class="sourceLineNo">5535</span> @Override<a name="line.5535"></a>
- <span class="sourceLineNo">5536</span> public Object clone() throws CloneNotSupportedException {<a name="line.5536"></a>
- <span class="sourceLineNo">5537</span> XYPlot clone = (XYPlot) super.clone();<a name="line.5537"></a>
- <span class="sourceLineNo">5538</span> clone.domainAxes = CloneUtils.cloneMapValues(this.domainAxes);<a name="line.5538"></a>
- <span class="sourceLineNo">5539</span> for (ValueAxis axis : clone.domainAxes.values()) {<a name="line.5539"></a>
- <span class="sourceLineNo">5540</span> if (axis != null) {<a name="line.5540"></a>
- <span class="sourceLineNo">5541</span> axis.setPlot(clone);<a name="line.5541"></a>
- <span class="sourceLineNo">5542</span> axis.addChangeListener(clone);<a name="line.5542"></a>
- <span class="sourceLineNo">5543</span> }<a name="line.5543"></a>
- <span class="sourceLineNo">5544</span> }<a name="line.5544"></a>
- <span class="sourceLineNo">5545</span> clone.rangeAxes = CloneUtils.cloneMapValues(this.rangeAxes);<a name="line.5545"></a>
- <span class="sourceLineNo">5546</span> for (ValueAxis axis : clone.rangeAxes.values()) {<a name="line.5546"></a>
- <span class="sourceLineNo">5547</span> if (axis != null) {<a name="line.5547"></a>
- <span class="sourceLineNo">5548</span> axis.setPlot(clone);<a name="line.5548"></a>
- <span class="sourceLineNo">5549</span> axis.addChangeListener(clone);<a name="line.5549"></a>
- <span class="sourceLineNo">5550</span> }<a name="line.5550"></a>
- <span class="sourceLineNo">5551</span> }<a name="line.5551"></a>
- <span class="sourceLineNo">5552</span> clone.domainAxisLocations = new HashMap<Integer, AxisLocation>(<a name="line.5552"></a>
- <span class="sourceLineNo">5553</span> this.domainAxisLocations);<a name="line.5553"></a>
- <span class="sourceLineNo">5554</span> clone.rangeAxisLocations = new HashMap<Integer, AxisLocation>(<a name="line.5554"></a>
- <span class="sourceLineNo">5555</span> this.rangeAxisLocations);<a name="line.5555"></a>
- <span class="sourceLineNo">5556</span><a name="line.5556"></a>
- <span class="sourceLineNo">5557</span> // the datasets are not cloned, but listeners need to be added...<a name="line.5557"></a>
- <span class="sourceLineNo">5558</span> clone.datasets = new HashMap<Integer, XYDataset>(this.datasets);<a name="line.5558"></a>
- <span class="sourceLineNo">5559</span> for (XYDataset dataset : clone.datasets.values()) {<a name="line.5559"></a>
- <span class="sourceLineNo">5560</span> if (dataset != null) {<a name="line.5560"></a>
- <span class="sourceLineNo">5561</span> dataset.addChangeListener(clone);<a name="line.5561"></a>
- <span class="sourceLineNo">5562</span> }<a name="line.5562"></a>
- <span class="sourceLineNo">5563</span> }<a name="line.5563"></a>
- <span class="sourceLineNo">5564</span><a name="line.5564"></a>
- <span class="sourceLineNo">5565</span> clone.datasetToDomainAxesMap = new TreeMap();<a name="line.5565"></a>
- <span class="sourceLineNo">5566</span> clone.datasetToDomainAxesMap.putAll(this.datasetToDomainAxesMap);<a name="line.5566"></a>
- <span class="sourceLineNo">5567</span> clone.datasetToRangeAxesMap = new TreeMap();<a name="line.5567"></a>
- <span class="sourceLineNo">5568</span> clone.datasetToRangeAxesMap.putAll(this.datasetToRangeAxesMap);<a name="line.5568"></a>
- <span class="sourceLineNo">5569</span><a name="line.5569"></a>
- <span class="sourceLineNo">5570</span> clone.renderers = CloneUtils.cloneMapValues(this.renderers);<a name="line.5570"></a>
- <span class="sourceLineNo">5571</span> for (XYItemRenderer renderer : clone.renderers.values()) {<a name="line.5571"></a>
- <span class="sourceLineNo">5572</span> if (renderer != null) {<a name="line.5572"></a>
- <span class="sourceLineNo">5573</span> renderer.setPlot(clone);<a name="line.5573"></a>
- <span class="sourceLineNo">5574</span> renderer.addChangeListener(clone);<a name="line.5574"></a>
- <span class="sourceLineNo">5575</span> }<a name="line.5575"></a>
- <span class="sourceLineNo">5576</span> }<a name="line.5576"></a>
- <span class="sourceLineNo">5577</span> clone.foregroundDomainMarkers = (Map) ObjectUtilities.clone(<a name="line.5577"></a>
- <span class="sourceLineNo">5578</span> this.foregroundDomainMarkers);<a name="line.5578"></a>
- <span class="sourceLineNo">5579</span> clone.backgroundDomainMarkers = (Map) ObjectUtilities.clone(<a name="line.5579"></a>
- <span class="sourceLineNo">5580</span> this.backgroundDomainMarkers);<a name="line.5580"></a>
- <span class="sourceLineNo">5581</span> clone.foregroundRangeMarkers = (Map) ObjectUtilities.clone(<a name="line.5581"></a>
- <span class="sourceLineNo">5582</span> this.foregroundRangeMarkers);<a name="line.5582"></a>
- <span class="sourceLineNo">5583</span> clone.backgroundRangeMarkers = (Map) ObjectUtilities.clone(<a name="line.5583"></a>
- <span class="sourceLineNo">5584</span> this.backgroundRangeMarkers);<a name="line.5584"></a>
- <span class="sourceLineNo">5585</span> clone.annotations = (List) ObjectUtilities.deepClone(this.annotations);<a name="line.5585"></a>
- <span class="sourceLineNo">5586</span> if (this.fixedDomainAxisSpace != null) {<a name="line.5586"></a>
- <span class="sourceLineNo">5587</span> clone.fixedDomainAxisSpace = (AxisSpace) ObjectUtilities.clone(<a name="line.5587"></a>
- <span class="sourceLineNo">5588</span> this.fixedDomainAxisSpace);<a name="line.5588"></a>
- <span class="sourceLineNo">5589</span> }<a name="line.5589"></a>
- <span class="sourceLineNo">5590</span> if (this.fixedRangeAxisSpace != null) {<a name="line.5590"></a>
- <span class="sourceLineNo">5591</span> clone.fixedRangeAxisSpace = (AxisSpace) ObjectUtilities.clone(<a name="line.5591"></a>
- <span class="sourceLineNo">5592</span> this.fixedRangeAxisSpace);<a name="line.5592"></a>
- <span class="sourceLineNo">5593</span> }<a name="line.5593"></a>
- <span class="sourceLineNo">5594</span> if (this.fixedLegendItems != null) {<a name="line.5594"></a>
- <span class="sourceLineNo">5595</span> clone.fixedLegendItems<a name="line.5595"></a>
- <span class="sourceLineNo">5596</span> = (LegendItemCollection) this.fixedLegendItems.clone();<a name="line.5596"></a>
- <span class="sourceLineNo">5597</span> }<a name="line.5597"></a>
- <span class="sourceLineNo">5598</span> clone.quadrantOrigin = (Point2D) ObjectUtilities.clone(<a name="line.5598"></a>
- <span class="sourceLineNo">5599</span> this.quadrantOrigin);<a name="line.5599"></a>
- <span class="sourceLineNo">5600</span> clone.quadrantPaint = this.quadrantPaint.clone();<a name="line.5600"></a>
- <span class="sourceLineNo">5601</span> return clone;<a name="line.5601"></a>
- <span class="sourceLineNo">5602</span><a name="line.5602"></a>
- <span class="sourceLineNo">5603</span> }<a name="line.5603"></a>
- <span class="sourceLineNo">5604</span><a name="line.5604"></a>
- <span class="sourceLineNo">5605</span> /**<a name="line.5605"></a>
- <span class="sourceLineNo">5606</span> * Provides serialization support.<a name="line.5606"></a>
- <span class="sourceLineNo">5607</span> *<a name="line.5607"></a>
- <span class="sourceLineNo">5608</span> * @param stream the output stream.<a name="line.5608"></a>
- <span class="sourceLineNo">5609</span> *<a name="line.5609"></a>
- <span class="sourceLineNo">5610</span> * @throws IOException if there is an I/O error.<a name="line.5610"></a>
- <span class="sourceLineNo">5611</span> */<a name="line.5611"></a>
- <span class="sourceLineNo">5612</span> private void writeObject(ObjectOutputStream stream) throws IOException {<a name="line.5612"></a>
- <span class="sourceLineNo">5613</span> stream.defaultWriteObject();<a name="line.5613"></a>
- <span class="sourceLineNo">5614</span> SerialUtilities.writeStroke(this.domainGridlineStroke, stream);<a name="line.5614"></a>
- <span class="sourceLineNo">5615</span> SerialUtilities.writePaint(this.domainGridlinePaint, stream);<a name="line.5615"></a>
- <span class="sourceLineNo">5616</span> SerialUtilities.writeStroke(this.rangeGridlineStroke, stream);<a name="line.5616"></a>
- <span class="sourceLineNo">5617</span> SerialUtilities.writePaint(this.rangeGridlinePaint, stream);<a name="line.5617"></a>
- <span class="sourceLineNo">5618</span> SerialUtilities.writeStroke(this.domainMinorGridlineStroke, stream);<a name="line.5618"></a>
- <span class="sourceLineNo">5619</span> SerialUtilities.writePaint(this.domainMinorGridlinePaint, stream);<a name="line.5619"></a>
- <span class="sourceLineNo">5620</span> SerialUtilities.writeStroke(this.rangeMinorGridlineStroke, stream);<a name="line.5620"></a>
- <span class="sourceLineNo">5621</span> SerialUtilities.writePaint(this.rangeMinorGridlinePaint, stream);<a name="line.5621"></a>
- <span class="sourceLineNo">5622</span> SerialUtilities.writeStroke(this.rangeZeroBaselineStroke, stream);<a name="line.5622"></a>
- <span class="sourceLineNo">5623</span> SerialUtilities.writePaint(this.rangeZeroBaselinePaint, stream);<a name="line.5623"></a>
- <span class="sourceLineNo">5624</span> SerialUtilities.writeStroke(this.domainCrosshairStroke, stream);<a name="line.5624"></a>
- <span class="sourceLineNo">5625</span> SerialUtilities.writePaint(this.domainCrosshairPaint, stream);<a name="line.5625"></a>
- <span class="sourceLineNo">5626</span> SerialUtilities.writeStroke(this.rangeCrosshairStroke, stream);<a name="line.5626"></a>
- <span class="sourceLineNo">5627</span> SerialUtilities.writePaint(this.rangeCrosshairPaint, stream);<a name="line.5627"></a>
- <span class="sourceLineNo">5628</span> SerialUtilities.writePaint(this.domainTickBandPaint, stream);<a name="line.5628"></a>
- <span class="sourceLineNo">5629</span> SerialUtilities.writePaint(this.rangeTickBandPaint, stream);<a name="line.5629"></a>
- <span class="sourceLineNo">5630</span> SerialUtilities.writePoint2D(this.quadrantOrigin, stream);<a name="line.5630"></a>
- <span class="sourceLineNo">5631</span> for (int i = 0; i < 4; i++) {<a name="line.5631"></a>
- <span class="sourceLineNo">5632</span> SerialUtilities.writePaint(this.quadrantPaint[i], stream);<a name="line.5632"></a>
- <span class="sourceLineNo">5633</span> }<a name="line.5633"></a>
- <span class="sourceLineNo">5634</span> SerialUtilities.writeStroke(this.domainZeroBaselineStroke, stream);<a name="line.5634"></a>
- <span class="sourceLineNo">5635</span> SerialUtilities.writePaint(this.domainZeroBaselinePaint, stream);<a name="line.5635"></a>
- <span class="sourceLineNo">5636</span> }<a name="line.5636"></a>
- <span class="sourceLineNo">5637</span><a name="line.5637"></a>
- <span class="sourceLineNo">5638</span> /**<a name="line.5638"></a>
- <span class="sourceLineNo">5639</span> * Provides serialization support.<a name="line.5639"></a>
- <span class="sourceLineNo">5640</span> *<a name="line.5640"></a>
- <span class="sourceLineNo">5641</span> * @param stream the input stream.<a name="line.5641"></a>
- <span class="sourceLineNo">5642</span> *<a name="line.5642"></a>
- <span class="sourceLineNo">5643</span> * @throws IOException if there is an I/O error.<a name="line.5643"></a>
- <span class="sourceLineNo">5644</span> * @throws ClassNotFoundException if there is a classpath problem.<a name="line.5644"></a>
- <span class="sourceLineNo">5645</span> */<a name="line.5645"></a>
- <span class="sourceLineNo">5646</span> private void readObject(ObjectInputStream stream)<a name="line.5646"></a>
- <span class="sourceLineNo">5647</span> throws IOException, ClassNotFoundException {<a name="line.5647"></a>
- <span class="sourceLineNo">5648</span><a name="line.5648"></a>
- <span class="sourceLineNo">5649</span> stream.defaultReadObject();<a name="line.5649"></a>
- <span class="sourceLineNo">5650</span> this.domainGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5650"></a>
- <span class="sourceLineNo">5651</span> this.domainGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5651"></a>
- <span class="sourceLineNo">5652</span> this.rangeGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5652"></a>
- <span class="sourceLineNo">5653</span> this.rangeGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5653"></a>
- <span class="sourceLineNo">5654</span> this.domainMinorGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5654"></a>
- <span class="sourceLineNo">5655</span> this.domainMinorGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5655"></a>
- <span class="sourceLineNo">5656</span> this.rangeMinorGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5656"></a>
- <span class="sourceLineNo">5657</span> this.rangeMinorGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5657"></a>
- <span class="sourceLineNo">5658</span> this.rangeZeroBaselineStroke = SerialUtilities.readStroke(stream);<a name="line.5658"></a>
- <span class="sourceLineNo">5659</span> this.rangeZeroBaselinePaint = SerialUtilities.readPaint(stream);<a name="line.5659"></a>
- <span class="sourceLineNo">5660</span> this.domainCrosshairStroke = SerialUtilities.readStroke(stream);<a name="line.5660"></a>
- <span class="sourceLineNo">5661</span> this.domainCrosshairPaint = SerialUtilities.readPaint(stream);<a name="line.5661"></a>
- <span class="sourceLineNo">5662</span> this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);<a name="line.5662"></a>
- <span class="sourceLineNo">5663</span> this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);<a name="line.5663"></a>
- <span class="sourceLineNo">5664</span> this.domainTickBandPaint = SerialUtilities.readPaint(stream);<a name="line.5664"></a>
- <span class="sourceLineNo">5665</span> this.rangeTickBandPaint = SerialUtilities.readPaint(stream);<a name="line.5665"></a>
- <span class="sourceLineNo">5666</span> this.quadrantOrigin = SerialUtilities.readPoint2D(stream);<a name="line.5666"></a>
- <span class="sourceLineNo">5667</span> this.quadrantPaint = new Paint[4];<a name="line.5667"></a>
- <span class="sourceLineNo">5668</span> for (int i = 0; i < 4; i++) {<a name="line.5668"></a>
- <span class="sourceLineNo">5669</span> this.quadrantPaint[i] = SerialUtilities.readPaint(stream);<a name="line.5669"></a>
- <span class="sourceLineNo">5670</span> }<a name="line.5670"></a>
- <span class="sourceLineNo">5671</span><a name="line.5671"></a>
- <span class="sourceLineNo">5672</span> this.domainZeroBaselineStroke = SerialUtilities.readStroke(stream);<a name="line.5672"></a>
- <span class="sourceLineNo">5673</span> this.domainZeroBaselinePaint = SerialUtilities.readPaint(stream);<a name="line.5673"></a>
- <span class="sourceLineNo">5674</span><a name="line.5674"></a>
- <span class="sourceLineNo">5675</span> // register the plot as a listener with its axes, datasets, and<a name="line.5675"></a>
- <span class="sourceLineNo">5676</span> // renderers...<a name="line.5676"></a>
- <span class="sourceLineNo">5677</span> for (ValueAxis axis : this.domainAxes.values()) {<a name="line.5677"></a>
- <span class="sourceLineNo">5678</span> if (axis != null) {<a name="line.5678"></a>
- <span class="sourceLineNo">5679</span> axis.setPlot(this);<a name="line.5679"></a>
- <span class="sourceLineNo">5680</span> axis.addChangeListener(this);<a name="line.5680"></a>
- <span class="sourceLineNo">5681</span> }<a name="line.5681"></a>
- <span class="sourceLineNo">5682</span> }<a name="line.5682"></a>
- <span class="sourceLineNo">5683</span> for (ValueAxis axis : this.rangeAxes.values()) {<a name="line.5683"></a>
- <span class="sourceLineNo">5684</span> if (axis != null) {<a name="line.5684"></a>
- <span class="sourceLineNo">5685</span> axis.setPlot(this);<a name="line.5685"></a>
- <span class="sourceLineNo">5686</span> axis.addChangeListener(this);<a name="line.5686"></a>
- <span class="sourceLineNo">5687</span> }<a name="line.5687"></a>
- <span class="sourceLineNo">5688</span> }<a name="line.5688"></a>
- <span class="sourceLineNo">5689</span> for (XYDataset dataset : this.datasets.values()) {<a name="line.5689"></a>
- <span class="sourceLineNo">5690</span> if (dataset != null) {<a name="line.5690"></a>
- <span class="sourceLineNo">5691</span> dataset.addChangeListener(this);<a name="line.5691"></a>
- <span class="sourceLineNo">5692</span> }<a name="line.5692"></a>
- <span class="sourceLineNo">5693</span> }<a name="line.5693"></a>
- <span class="sourceLineNo">5694</span> for (XYItemRenderer renderer : this.renderers.values()) {<a name="line.5694"></a>
- <span class="sourceLineNo">5695</span> if (renderer != null) {<a name="line.5695"></a>
- <span class="sourceLineNo">5696</span> renderer.addChangeListener(this);<a name="line.5696"></a>
- <span class="sourceLineNo">5697</span> }<a name="line.5697"></a>
- <span class="sourceLineNo">5698</span> }<a name="line.5698"></a>
- <span class="sourceLineNo">5699</span><a name="line.5699"></a>
- <span class="sourceLineNo">5700</span> }<a name="line.5700"></a>
- <span class="sourceLineNo">5701</span><a name="line.5701"></a>
- <span class="sourceLineNo">5702</span>}<a name="line.5702"></a>
- </pre>
- </div>
- </body>
- </html>
|