<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;The high level of interactivity for pARP made it difficult to manage the drawing routines. We don&amp;#8217;t want to redraw the whole screen every time the mouse is moved, but at the same time we do want to update &lt;em&gt;some&lt;/em&gt; aspects of that screen. The solution to this was to use different buffers that are only redrawn if their content changes (see &lt;a href=&quot;http://processing.org/hacks/hacks:offscreen&quot;&gt;Processing Hacks&lt;/a&gt; for how that works). Buffers are basically only redrawn when necessary and the draw() function just loads all buffers. Depending on the type of user interaction (MouseMoved(), MouseClicked(), &amp;#8230;) certain buffers get redrawn.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a breakdown of the different buffers:&lt;/p&gt;
&lt;h3&gt;bufferCircularAll&lt;/h3&gt;
&lt;p&gt;Contains the part of the circular display that never changes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Outer ring showing chromosomes&lt;/li&gt;
	&lt;li&gt;Chromosome numbers&lt;/li&gt;
	&lt;li&gt;Grey connections for between-chromosomal readpairs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/82932180@N00/3079447979/&quot; title=&quot;buffer_circular_all by jandot, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3234/3079447979_8f45525c36.jpg&quot; width=&quot;311&quot; height=&quot;293&quot; alt=&quot;buffer_circular_all&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;bufferCircularHighlighted&lt;/h3&gt;
&lt;p&gt;Contains the highlighted readpairs when the mouse is near the circle. The background for this buffer is bufferCircularAll, so the picture shows bufferCircularHighlighted &lt;em&gt;superimposed&lt;/em&gt; on bufferCircularAll.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/82932180@N00/3080284036/&quot; title=&quot;buffer_circular_highlighted by jandot, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3152/3080284036_c4361cf149.jpg&quot; width=&quot;291&quot; height=&quot;290&quot; alt=&quot;buffer_circular_highlighted&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;bufferLinearIdeograms&lt;/h3&gt;
&lt;p&gt;Contains the part of the linear display that only changes when different chromosomes are selected:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The two ideograms&lt;/li&gt;
	&lt;li&gt;The baseline&lt;/li&gt;
	&lt;li&gt;The buttons&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/82932180@N00/3080284090/&quot; title=&quot;buffer_linear_ideograms by jandot, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3141/3080284090_33f8de7d3d.jpg&quot; width=&quot;500&quot; height=&quot;125&quot; alt=&quot;buffer_linear_ideograms&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;bufferLinearZoom&lt;/h3&gt;
&lt;p&gt;Contains the parts of the linear display that only change when the user zooms or pans:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The green zoom box&lt;/li&gt;
	&lt;li&gt;Readpairs&lt;/li&gt;
	&lt;li&gt;Features&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The background of this buffer is bufferLinearIdeograms, so the picture is a superposition of bufferLinearZoom onto bufferLinearIdeograms.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/82932180@N00/3080284124/&quot; title=&quot;buffer_linear_zoom by jandot, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3151/3080284124_4fa672eb55.jpg&quot; width=&quot;500&quot; height=&quot;125&quot; alt=&quot;buffer_linear_zoom&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;bufferLinearHighlighted&lt;/h3&gt;
&lt;p&gt;Buffer containing only elements that change when the user moves the mouse (i.e. the bit of text mentioning the position of the mouse cursor and the red highlights). Background for this buffer is bufferLinearZoom.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/82932180@N00/3080284166/&quot; title=&quot;buffer_linear_highlighted by jandot, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3295/3080284166_3a9a71184d.jpg&quot; width=&quot;500&quot; height=&quot;126&quot; alt=&quot;buffer_linear_highlighted&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;main draw&lt;/h3&gt;
&lt;p&gt;Some bits are drawn outside of any buffer and directly on screen:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the green line on the linear display that corresponds to the cursor position&lt;/li&gt;
	&lt;li&gt;the text mentioning the quality cutoff&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2009-11-21T23:12:08-08:00</created-at>
  <id type="integer">89838</id>
  <permalink>buffers</permalink>
  <repository-id type="integer">78614</repository-id>
  <title>Buffers</title>
  <updated-at type="datetime">2008-12-03T07:55:26-08:00</updated-at>
  <user-id type="integer">10043</user-id>
</wiki>
