<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Waterloo graphics animation and web deployment	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=waterloo-graphics-animation-web-deployment</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Mon, 22 Jul 2013 12:42:02 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-228192</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Mon, 22 Jul 2013 12:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-228192</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-228119&quot;&gt;Julien&lt;/a&gt;.

@Julien
One way for JLabel might be to create a myText property in your subclass. Compare the contents of that with the result returned by getText and override other methods (e.g. revalidate and paint) to call super.setText() as appropriate. Note though, there might be issues if the L&#038;F UI delegate calls into superclass methods during construction (usually an issue with Synth-based L&#038;Fs like Nimbus) and there could be synchronization issues. That may be why text is private to begin with.
Alternatively, copy the whole of JLabel. The GJGraph in Waterloo began as the JXGraph from the SwingX project (see the 1st blog about it). Rather than try overriding single methods I copied the whole class (it&#039;s LPGL) and started from there, in part because I kept hitting issues with private fields.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-228119">Julien</a>.</p>
<p>@Julien<br />
One way for JLabel might be to create a myText property in your subclass. Compare the contents of that with the result returned by getText and override other methods (e.g. revalidate and paint) to call super.setText() as appropriate. Note though, there might be issues if the L&amp;F UI delegate calls into superclass methods during construction (usually an issue with Synth-based L&amp;Fs like Nimbus) and there could be synchronization issues. That may be why text is private to begin with.<br />
Alternatively, copy the whole of JLabel. The GJGraph in Waterloo began as the JXGraph from the SwingX project (see the 1st blog about it). Rather than try overriding single methods I copied the whole class (it&#8217;s LPGL) and started from there, in part because I kept hitting issues with private fields.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julien		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-228119</link>

		<dc:creator><![CDATA[Julien]]></dc:creator>
		<pubDate>Mon, 22 Jul 2013 09:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-228119</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227278&quot;&gt;Malcolm Lidierth&lt;/a&gt;.

Thanks again Malcolm... 
Actually, even if I am not a Java expert, I do not need help to subclass a swing component and override one method. I do not have much funds to this kind of consulting work, so I prefer to reserve Yair more tricky and exciting tasks! 
To test your approach, I simply wanted to create a custom myJLabel class, which extends JLabel and overrides setText() method. In this method, I copied the setText() code from your link (thanks for the tip) and simply commented the repaint() line. However, because text property is private, I cannot modify it from the subclass without calling super.setText(), which calls repaint... 
On the other hand, I have not tried yet, but it should work for JTabbedPane.removeTabAt(int) because no private properties are modified.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227278">Malcolm Lidierth</a>.</p>
<p>Thanks again Malcolm&#8230;<br />
Actually, even if I am not a Java expert, I do not need help to subclass a swing component and override one method. I do not have much funds to this kind of consulting work, so I prefer to reserve Yair more tricky and exciting tasks!<br />
To test your approach, I simply wanted to create a custom myJLabel class, which extends JLabel and overrides setText() method. In this method, I copied the setText() code from your link (thanks for the tip) and simply commented the repaint() line. However, because text property is private, I cannot modify it from the subclass without calling super.setText(), which calls repaint&#8230;<br />
On the other hand, I have not tried yet, but it should work for JTabbedPane.removeTabAt(int) because no private properties are modified.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227278</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Sat, 20 Jul 2013 01:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-227278</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227060&quot;&gt;Julien&lt;/a&gt;.

@Julien
Understood. jTabbedPane.remove(tabIndex) calls removeTabAt(tabIndex) and that calls repaint()  which I suspect explains what you see. [JTable is rather different: probably the most complex of all swing components, and mixes data and visual elements in way that makes to impossible to comment on what you see without details.]

Google &quot;grep JTabbedPane remove&quot; to see the Java source code - Java is all open source.


A solution might be to subclass JTabbedPane and provide an additional method that allows removal of multiple tabs then calls repaint() only once. I do not see a way to do that MATLAB-side - neither could you rely simply on calling the JTabbedPane super class removeTab method in Java as that would still call repaint each time. It is not a huge task as the Oracle/Sun code shows most of what is needed to make it a Java subclass robust - so I suspect a professional programmer/consultant would quote a reasonable price if you are not happy doing it yourself (a man called Yair springs immediately to mind).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227060">Julien</a>.</p>
<p>@Julien<br />
Understood. jTabbedPane.remove(tabIndex) calls removeTabAt(tabIndex) and that calls repaint()  which I suspect explains what you see. [JTable is rather different: probably the most complex of all swing components, and mixes data and visual elements in way that makes to impossible to comment on what you see without details.]</p>
<p>Google &#8220;grep JTabbedPane remove&#8221; to see the Java source code &#8211; Java is all open source.</p>
<p>A solution might be to subclass JTabbedPane and provide an additional method that allows removal of multiple tabs then calls repaint() only once. I do not see a way to do that MATLAB-side &#8211; neither could you rely simply on calling the JTabbedPane super class removeTab method in Java as that would still call repaint each time. It is not a huge task as the Oracle/Sun code shows most of what is needed to make it a Java subclass robust &#8211; so I suspect a professional programmer/consultant would quote a reasonable price if you are not happy doing it yourself (a man called Yair springs immediately to mind).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julien		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-227060</link>

		<dc:creator><![CDATA[Julien]]></dc:creator>
		<pubDate>Fri, 19 Jul 2013 13:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-227060</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226977&quot;&gt;Malcolm Lidierth&lt;/a&gt;.

Thanks Malcolm for all these explanations which are very useful. 
I chose this very simple example because I thought it reflected well my problem, which is actually different. A JLabel appears to be a bad candidate, your explanations are very clear on this. However, if I replace the JLabel by a JTextField or a JEditorPane for example, the behavior is unfortunately the same.

The problem which inspired my initial comment is actually le following : 
I have a JTabbedPane with potentially more than 10 tabs, which can be added/removed interactively according to user&#039;s needs. When I want to close several tabs at a time, I loop on tab indexes and invoke jTabbedPane.remove(tabIndex). However, with this MATLAB-side approach, I see the tabs which disappear one by one onscreen, and I want to avoid this. I would prefer to see all the tabs that disapper or appear at a time.

A solution could be to write a java util class with static methos that would be responsible for adding or removing several tabs (a simple loop).  These methods would be invoked from MATLAB and executed on the EDT (using javaMethodEDT), in order to ensure that synchronous repaints will be done only after the method&#039;s execution is completed (which is not the case when you do the equivalent loop MATLAB-side). I already tried this with JTable selections updates and it works well. However, in this specific case, I would like to avoid this (if you are interested, I could tell you more offline about this).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226977">Malcolm Lidierth</a>.</p>
<p>Thanks Malcolm for all these explanations which are very useful.<br />
I chose this very simple example because I thought it reflected well my problem, which is actually different. A JLabel appears to be a bad candidate, your explanations are very clear on this. However, if I replace the JLabel by a JTextField or a JEditorPane for example, the behavior is unfortunately the same.</p>
<p>The problem which inspired my initial comment is actually le following :<br />
I have a JTabbedPane with potentially more than 10 tabs, which can be added/removed interactively according to user&#8217;s needs. When I want to close several tabs at a time, I loop on tab indexes and invoke jTabbedPane.remove(tabIndex). However, with this MATLAB-side approach, I see the tabs which disappear one by one onscreen, and I want to avoid this. I would prefer to see all the tabs that disapper or appear at a time.</p>
<p>A solution could be to write a java util class with static methos that would be responsible for adding or removing several tabs (a simple loop).  These methods would be invoked from MATLAB and executed on the EDT (using javaMethodEDT), in order to ensure that synchronous repaints will be done only after the method&#8217;s execution is completed (which is not the case when you do the equivalent loop MATLAB-side). I already tried this with JTable selections updates and it works well. However, in this specific case, I would like to avoid this (if you are interested, I could tell you more offline about this).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226977</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Fri, 19 Jul 2013 09:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-226977</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226946&quot;&gt;Julien&lt;/a&gt;.

@Julien

There are two problems:

1. Updating the text property has to be done on the EDT to ensure that calls to getText on the EDT will see the changes. That is the point of a single-threaded model for AWT/Swing. For JLabel, this is not thread-safe (it is for Swing text components like JTextField).
The simplest way to avoid updating the text property 2000 times is not to write code that does that!
However, the overhead is simply setting the property is not enormous. The problem is that for a JLabel, the setText method calls repaint().
Here&#039;s the code, which I have edited for clarity. Note that there is no check that we are on the EDT and no code to repost to the EDT (JLabel&#039;s setText is not thread-safe). As you point out, MATLAB will ensure the code is called on the EDT when javacomponent has been used. Note that text is a bound property - if the property change listeners call repaint, mutiple repaint calls will be issued for each call to setText.

&lt;pre lang=&quot;java&quot;&gt;
    public void setText(String text) {
        ......
        String oldValue = this.text;
        this.text = text;
        firePropertyChange(&quot;text&quot;, oldValue, text);
        ......
        if (text == null &#124;&#124; oldValue == null &#124;&#124; !text.equals(oldValue)) {
            revalidate();
            repaint();
        }
    }
&lt;/pre&gt;

2. The repaint will run on the EDT - whether or not javacomponent has been used - as repaint is a thread-safe method (N.B. for standard Swing components - always check when using custom subclasses). 
Rendering the JLabel to screen is managed by the Swing repaint manager. That does not run on the EDT but analyses the repaint queue and collapses multiple calls to repaint the same screen area into a single call. When it is done, it calls the relevant Swing repaint methods which refresh the screen (on the EDT with the collapsed data). So despite the multiple calls to repaint, the repaint manager should reduce the work needed.

Flushing the event queue with &lt;em&gt;pause&lt;/em&gt; or &lt;em&gt;drawnow&lt;/em&gt; will disrupt that, forcing more repaints than needed - which I assume is why Yair put those outside the loop in the code above.

How you solve the problem depends on the use-case but a JLabel, or any other Swing component, will not always be the right tool for the job.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226946">Julien</a>.</p>
<p>@Julien</p>
<p>There are two problems:</p>
<p>1. Updating the text property has to be done on the EDT to ensure that calls to getText on the EDT will see the changes. That is the point of a single-threaded model for AWT/Swing. For JLabel, this is not thread-safe (it is for Swing text components like JTextField).<br />
The simplest way to avoid updating the text property 2000 times is not to write code that does that!<br />
However, the overhead is simply setting the property is not enormous. The problem is that for a JLabel, the setText method calls repaint().<br />
Here&#8217;s the code, which I have edited for clarity. Note that there is no check that we are on the EDT and no code to repost to the EDT (JLabel&#8217;s setText is not thread-safe). As you point out, MATLAB will ensure the code is called on the EDT when javacomponent has been used. Note that text is a bound property &#8211; if the property change listeners call repaint, mutiple repaint calls will be issued for each call to setText.</p>
<pre lang="java">
    public void setText(String text) {
        ......
        String oldValue = this.text;
        this.text = text;
        firePropertyChange("text", oldValue, text);
        ......
        if (text == null || oldValue == null || !text.equals(oldValue)) {
            revalidate();
            repaint();
        }
    }
</pre>
<p>2. The repaint will run on the EDT &#8211; whether or not javacomponent has been used &#8211; as repaint is a thread-safe method (N.B. for standard Swing components &#8211; always check when using custom subclasses).<br />
Rendering the JLabel to screen is managed by the Swing repaint manager. That does not run on the EDT but analyses the repaint queue and collapses multiple calls to repaint the same screen area into a single call. When it is done, it calls the relevant Swing repaint methods which refresh the screen (on the EDT with the collapsed data). So despite the multiple calls to repaint, the repaint manager should reduce the work needed.</p>
<p>Flushing the event queue with <em>pause</em> or <em>drawnow</em> will disrupt that, forcing more repaints than needed &#8211; which I assume is why Yair put those outside the loop in the code above.</p>
<p>How you solve the problem depends on the use-case but a JLabel, or any other Swing component, will not always be the right tool for the job.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julien		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226946</link>

		<dc:creator><![CDATA[Julien]]></dc:creator>
		<pubDate>Fri, 19 Jul 2013 07:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-226946</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226762&quot;&gt;Yair Altman&lt;/a&gt;.

Thanks for your fast answer. I really carefully read all of your posts, especially those related to the integration of java components inside matlab figures. In particular, the EDT&#039;s one is extremely usefull and interesting, but some points are still unclear to me.
In the code snippet above, I forgot one line which corresponds to the rendering of the component with javacomponent.
&lt;pre lang=&quot;matlab&quot;&gt;
jLab   = javax.swing.JLabel;
[HJ,M] = javacomponent(jLab,[10 10 100 30],figure); % This puts JLabel on EDT
for i=1:20000
    jLab.setText(num2str(i));
end
&lt;/pre&gt; 
Actually, as you mention in your post, javacomponent&#039;s function puts component on the EDT, even if it was initially created on MT. That&#039;s why with your example, unfortunately, it does not work better...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226762">Yair Altman</a>.</p>
<p>Thanks for your fast answer. I really carefully read all of your posts, especially those related to the integration of java components inside matlab figures. In particular, the EDT&#8217;s one is extremely usefull and interesting, but some points are still unclear to me.<br />
In the code snippet above, I forgot one line which corresponds to the rendering of the component with javacomponent.</p>
<pre lang="matlab">
jLab   = javax.swing.JLabel;
[HJ,M] = javacomponent(jLab,[10 10 100 30],figure); % This puts JLabel on EDT
for i=1:20000
    jLab.setText(num2str(i));
end
</pre>
<p>Actually, as you mention in your post, javacomponent&#8217;s function puts component on the EDT, even if it was initially created on MT. That&#8217;s why with your example, unfortunately, it does not work better&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226762</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 18 Jul 2013 20:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-226762</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226758&quot;&gt;Julien&lt;/a&gt;.

@Julien - the easiest (and &lt;b&gt;unsafe&lt;/b&gt;!) way is simply NOT to create the &lt;code&gt;JLabel&lt;/code&gt; on the EDT in the first place, and only issue a &lt;i&gt;&lt;b&gt;drawnow&lt;/b&gt;&lt;/i&gt; and/or &lt;code&gt;jLab.repaint&lt;/code&gt; when you really want to update the GUI:

&lt;pre lang=&#039;matlab&#039;&gt;
jLab = javax.swing.JLabel;   % runs directly on MT, not EDT - careful!
for i=1:1000
    jLab.setText(num2str(i));
end
drawnow; pause(0.01); jLab.repaint;   % refresh the GUI
&lt;/pre&gt;

See http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/ for more details on using Matlab with EDT]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226758">Julien</a>.</p>
<p>@Julien &#8211; the easiest (and <b>unsafe</b>!) way is simply NOT to create the <code>JLabel</code> on the EDT in the first place, and only issue a <i><b>drawnow</b></i> and/or <code>jLab.repaint</code> when you really want to update the GUI:</p>
<pre lang='matlab'>
jLab = javax.swing.JLabel;   % runs directly on MT, not EDT - careful!
for i=1:1000
    jLab.setText(num2str(i));
end
drawnow; pause(0.01); jLab.repaint;   % refresh the GUI
</pre>
<p>See <a href="http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/" rel="ugc">http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/</a> for more details on using Matlab with EDT</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julien		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-226758</link>

		<dc:creator><![CDATA[Julien]]></dc:creator>
		<pubDate>Thu, 18 Jul 2013 20:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-226758</guid>

					<description><![CDATA[Malcolm,
Congratulations for this very impressive library which looks very attractive...
Because you seem to be an EDT expert, I was wondering if you knew a way to synchronize graphics update of java components (integrated with javacomponent function) with drawnow mechanism ?
Because I am not sure to be clear, here is an example :
&lt;pre Lang=&quot;matlab&quot;&gt;
jLab = javaObjectEDT(&#039;javax.swing.JLabel&#039;);
for i=1:1000
    jLab.setText(num2str(i));
end
&lt;/pre&gt;
When we run this code, JLabel&#039;s string is updated at each iteration. To have a similar behavior with uicontrol&#039;s implementation, a drawnow has to be added in the loop.
So, do you know how, in the example above, we can prevent java component&#039;s graphics from being updated at each iteration ?]]></description>
			<content:encoded><![CDATA[<p>Malcolm,<br />
Congratulations for this very impressive library which looks very attractive&#8230;<br />
Because you seem to be an EDT expert, I was wondering if you knew a way to synchronize graphics update of java components (integrated with javacomponent function) with drawnow mechanism ?<br />
Because I am not sure to be clear, here is an example :</p>
<pre Lang="matlab">
jLab = javaObjectEDT('javax.swing.JLabel');
for i=1:1000
    jLab.setText(num2str(i));
end
</pre>
<p>When we run this code, JLabel&#8217;s string is updated at each iteration. To have a similar behavior with uicontrol&#8217;s implementation, a drawnow has to be added in the loop.<br />
So, do you know how, in the example above, we can prevent java component&#8217;s graphics from being updated at each iteration ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222870</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Tue, 09 Jul 2013 14:03:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-222870</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222618&quot;&gt;Andrew&lt;/a&gt;.

It occurs to me that some of &lt;a href=&quot;http://undocumentedmatlab.com/blog/waterloo-graphics-beta/&quot; rel=&quot;nofollow&quot;&gt;last week&#039;s &lt;/a&gt;illustrations are useful here. The Lincoln Penny contours created a set of colors from the Colors class. These used the &lt;a href=&quot;http://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueDarkRed18.shtml&quot; rel=&quot;nofollow&quot;&gt;BlueDarkRed18 &lt;/a&gt;color scheme. The color contrasts in the figures will be visible to those with all 3 common forms of colour-blindness. For those with full colour vision, you can check it out using the app from http://colororacle.org.

As per Yair&#039;s comment above: general comments/suggestions about Waterloo are always welcome at
&lt;a href=&quot;http://sourceforge.net/p/waterloo/discussion/general/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/p/waterloo/discussion/general/&lt;/a&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222618">Andrew</a>.</p>
<p>It occurs to me that some of <a href="http://undocumentedmatlab.com/blog/waterloo-graphics-beta/" rel="nofollow">last week&#8217;s </a>illustrations are useful here. The Lincoln Penny contours created a set of colors from the Colors class. These used the <a href="http://www.ncl.ucar.edu/Document/Graphics/ColorTables/BlueDarkRed18.shtml" rel="nofollow">BlueDarkRed18 </a>color scheme. The color contrasts in the figures will be visible to those with all 3 common forms of colour-blindness. For those with full colour vision, you can check it out using the app from <a href="http://colororacle.org" rel="nofollow ugc">http://colororacle.org</a>.</p>
<p>As per Yair&#8217;s comment above: general comments/suggestions about Waterloo are always welcome at<br />
<a href="http://sourceforge.net/p/waterloo/discussion/general/" rel="nofollow">http://sourceforge.net/p/waterloo/discussion/general/</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Malcolm Lidierth		</title>
		<link>https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222845</link>

		<dc:creator><![CDATA[Malcolm Lidierth]]></dc:creator>
		<pubDate>Tue, 09 Jul 2013 12:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3944#comment-222845</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222624&quot;&gt;Yair Altman&lt;/a&gt;.

@Andrew

The defaults are user-settable using the preferences dialog above for plots and axes. Colors, line thicknesses etc can all be set and saved for use across MATLAB sessions. All the setLeftAxisPainted(false) etc calls above could have been avoided if this were the defualt setting. 

The settings are saved to XML in the $(java.home)/waterlooSettings folder and so kept across Waterloo updates too. That XML file can of course be shared across a team - so imposing a &quot;corporate&quot; theme. I would be happy to include a &quot;theme&quot; selector if users wanted to contribute their settings to the project.

One note of caution - the defaults table is referenced in the constructors and is a singleton instance. It is swapped during serialisation/deserialization of Waterloo files to allow the standard bean XML coder/decoder to be used. This results in graphs always using the defaults chosen by the user who created the file rather than the user opening it - The values can be edited - but the keys should not be, to ensure portability. 

Eventually this may all be styled via CSS, but that is some way off. 

You point is well taken and the beta version includes some preliminary work on colour schemes in the Colors class included in the kcl.waterloo.defaults package. There is a substantial literature on these issues notably in designing aircraft control GUIs (where the emphasis is on guiding the eye away from extraneous elements) and mapping (where the emphasis is on avoiding false impressions because of poorly chosen colours).  Add to that the requirement to address the needs of those with colour-vision impairments and produce good output for both print and web media and you see that it is not a simple issue.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/waterloo-graphics-animation-web-deployment#comment-222624">Yair Altman</a>.</p>
<p>@Andrew</p>
<p>The defaults are user-settable using the preferences dialog above for plots and axes. Colors, line thicknesses etc can all be set and saved for use across MATLAB sessions. All the setLeftAxisPainted(false) etc calls above could have been avoided if this were the defualt setting. </p>
<p>The settings are saved to XML in the $(java.home)/waterlooSettings folder and so kept across Waterloo updates too. That XML file can of course be shared across a team &#8211; so imposing a &#8220;corporate&#8221; theme. I would be happy to include a &#8220;theme&#8221; selector if users wanted to contribute their settings to the project.</p>
<p>One note of caution &#8211; the defaults table is referenced in the constructors and is a singleton instance. It is swapped during serialisation/deserialization of Waterloo files to allow the standard bean XML coder/decoder to be used. This results in graphs always using the defaults chosen by the user who created the file rather than the user opening it &#8211; The values can be edited &#8211; but the keys should not be, to ensure portability. </p>
<p>Eventually this may all be styled via CSS, but that is some way off. </p>
<p>You point is well taken and the beta version includes some preliminary work on colour schemes in the Colors class included in the kcl.waterloo.defaults package. There is a substantial literature on these issues notably in designing aircraft control GUIs (where the emphasis is on guiding the eye away from extraneous elements) and mapping (where the emphasis is on avoiding false impressions because of poorly chosen colours).  Add to that the requirement to address the needs of those with colour-vision impairments and produce good output for both print and web media and you see that it is not a simple issue.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
