<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Pete Morgan&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/panaseam/" />
<modified>2006-11-02T22:05:20Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/panaseam/350</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2006, panaseam</copyright>
<entry>
<title>Of Netbeans form files, Widget macros and Matisse.</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/panaseam/archive/2006/10/of_netbeans_for_1.html" />
<modified>2006-11-02T22:05:20Z</modified>
<issued>2006-10-29T21:18:24Z</issued>
<id>tag:weblogs.java.net,2006:/blog/panaseam/350.5819</id>
<created>2006-10-29T21:18:24Z</created>
<summary type="text/plain">Pete Morgan has tripped over a Netbeans form file and wants to know if macro Widgets can help, also is Matisse a control freak?</summary>
<author>
<name>panaseam</name>

<email>pete.rickhayes@btinternet.com</email>
</author>
<dc:subject>Community: Java Tools</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/panaseam/">
<![CDATA[Just recently I've been tinkering with my <a href="https://panaseam.dev.java.net/">project</a> particularly in the realm of<br>
“Widget tweaking”. I won't bore you with the details, but suffice to say that<br>
“Something strange happened to me on the way to the repository!”<br>
<br>
Basically I was editing my component source then checking that my changes worked OK in<br>
Netbeans. The problem occurred when I made a mistake in a container class and the IDE<br>
registered it as a component. I investigated the problem, saw my stupid mistake and rectified it.<br>
So having closed my test form in the IDE, I reopened it but, to my dismay, the damn thing was<br>
still not behaving like a container. My first thought was that the class was not being unloaded<br>
by the VM. So I put a bit of code in to fire a message box. This worked, so the IDE was<br>
obviously doing the right thing with class loading (I never doubted it really!) but the thing<br>
was still registered as a sub component.<br>
<br>
I then tried adding another instance of my container class and “lo and behold” this correctly<br>
registered itself as a container.Then the penny dropped. I opened the form file in another editor<br>
and sure enough there was my original instance tagged as a component<br>
and my new instance tagged as a container.<br>
<br>
Now I'm sure many people will think “how stupid can this guy be?” either because they think I<br>
should use Eclipse or simply that I should have known Netbeans would retain the original tag.<br>
<br>
Well firstly, as there is only me on this project, making my widgets usable with Eclipse is still<br>
on the “to do” list, secondly, I suppose I did know about the contents of the form file but it just<br>
didn't dawn on me at the time. Of course it is, perhaps, an example of why some people do not<br>
like the idea of the form file controlling what happens in the IDE.<br>
<br>
I can see there are pro's and con's to the concept of a separate IDE control file, with it the<br>
integrity of the IDE generated stuff is probably safer from inadvertently screwing up by<br>
editing the source in another editor. But on the con side it is another file that must be<br>
maintained and if somehow it got out of sync with the java source ar worse still if it got lost...!<br>
Well it just doesn't bear thinking about.<br>
<br>
Anyway, the aim of this blog was not to start another Netbeans vs Eclipse (or any other IDE)<br>
flame war, it's about my fun and games with creating compound components or widgets as I<br>
prefer to call them which leads me to my next point, which is more of a request for comment.<br>
<br>
<b><u>Widget Macros (or Macro Widgets).</u></b><br>
Whilst getting confused with the niceties, or otherwise, of Netbeans form files, I started musing<br>
about the problem of compound widgets in an IDE. What I mean is creating a widget<br>
that contains sub components. Obviously the IDE has no visibility to the inner components of<br>
such a compound widget. This can be a pain if you just want to tweak an odd property as you<br>
either have to wrap the required sub component methods in your widget class API or you could<br>
provide access to the sub components with suitable getter methods, but it isn't very elegant.<br>
<br>
So what I wondered was, and this could apply to any IDE, would it be feasible to derive a sort<br>
of macro approach where a compound widget could be assembled using the IDE as if it were<br>
a normal form and then saved, in source form, as a macro “template” which could be inserted<br>
into a real form at design time, expanded out so that all the inner parts of the widget became<br>
separately visible to the IDE but bound together in some way to prevent breaking the<br>
predefined relationship of the widget's sub components.<br>
<br>
It's probably a daft idea, or it's already been done. But I just wondered what anyone thinks?<br>
<br>
<b><u>Also: Matisse and ScollPanes who's in control?</u></b><br>
Whilst on the subject of IDEs, or Netbeans in particular. Is there any way to stop Matisse<br>
automatically adding a JScrollPane when you add a Scrollable component?<br>
I couldn't find any way but it could be I never looked in the right place!<br>
<br>
The reason I ask is that in the earlier version of my project I had created a JTextArea and a JList<br>
subclass that, at run time, automatically added a JScrollPane as an instance of either got added<br>
to my custom subclassed JPanel container.<br>
<br>
Matisse adding its own JScrollPane in such a case was a nuisance as it was not obvious to an<br>
end user that they must remove that JScrollPane. The new version of my widget appears to the<br>
IDE as a JComponent so Matisse ignores it, so the problem has gone away at the moment.<br>
<br>
I just wondered if there was an easy fix?<br>
<br>
If there isn't, then I would respectfully suggest there should be!<br>
<br>
Any automatic feature, no matter how brilliant should always allow the end user to switch it<br>
off if required.<br>

The switch should be a property associated with any form class so that templates can be<br>
created with the feature switched off if necessary. Or, alternatively, it should be possible to<br>
mark a widget class so that the feature was disabled even though the class implements Scrollable. <br>
<br>
Just my two pennies worth.<br>
<br>
Anyway enough of my ramblings!<br>
<br>
Happy hacking,<br>
<br>
Pete<br>]]>

</content>
</entry>
<entry>
<title>Java is on it&apos;s way out? Not from where I&apos;m standing!</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/panaseam/archive/2006/10/java_is_on_its_1.html" />
<modified>2006-10-05T23:23:13Z</modified>
<issued>2006-10-05T22:18:52Z</issued>
<id>tag:weblogs.java.net,2006:/blog/panaseam/350.5690</id>
<created>2006-10-05T22:18:52Z</created>
<summary type="text/plain">A bit of Java &quot;Flag Waving&quot; from a guy that doesn&apos;t know a servlet from a glass fish.</summary>
<author>
<name>panaseam</name>

<email>pete.rickhayes@btinternet.com</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/panaseam/">
<![CDATA[<p>I've just been musing over the current java.net poll <a href="http://www.java.net/pub/pq/122">What do you prefer for enterprise Java persistence?</a> and noticed that out of a total of 1425 votes cast 107 voted for "I don't develop enterprise Java". I am one of those 107.</p>

<p>Now I know the poll is about enterprise Java so you may get a slightly higher response rate from people that do develop enterprise Java, but this roughly indicates that 92.5% of java developers do enterprise Java development and 7.5% don't. Yes I also know the old saying about “lies, damn lies and statistics” and I can't help wondering how many of those developers also do desktop application development.</p>

<p>The reason for my interest in these numbers lies in the fact that in my nosing around the internet I often see posts by the “Java is dead” brigade, and whilst I have never tried quantifying anything, they also seem predominantly enterprise related rants.</p>

<p>To get to my point, I honestly think that Java, from my desktop only perspective, is “top of the pile”. To my mind Java encapsulates such a high percentage of whatever I need to do the job that I actually don't <b>have</b> to look elsewhere to get the job done. Swing is being improved all the time plus you have the innovative work of people like <a href="http://today.java.net/pub/a/today/2006/10/03/enhancing-swing-applications.html">Kirill Grouchnikov</a>, or you can use SWT if you prefer. And all this is platform independent! So from my vantage point Java is very much alive and kicking. </p>

<p>On the desktop you only really need one tool, an IDE, beyond that, with Java you have all you need to get developing. Yes you may prefer to use, for example third party widget libraries or re factoring tools etc., but you don't have to have them to be productive. Lets face it you could do without an IDE if you want. Yes just J2SE JDK, an editor and off you go!</p>

<p>I know Java gets knocked as a desktop environment as well, but quite frankly, unless you are a “ ' softy” and want to be ensnared in the "net", what other languages give you all you need in one package? Yes I am aware of the Mono project, but I don't get a warm comfortable feeling about it, I still feel that "net" closing round me!:-) We all know nothing is perfect, there is always room for improvement but all too often whingers make statements like “C# has pass by reference so Java should have it too, otherwise I'll just have to move over to C#”. &lt;rant&gt;Well all I can say is if a dumbass like me can emulate the whole <a href="https://panaseam.dev.java.net">VB core language in Java</a>, including, pass by ref, GoTos, weird operator precedence and pretty well every other VB strangeness then “Java don't need changing” and certainly not to keep some lame brain troll from “defecting to C#”!&lt;/rant&gt;</p>

<p>In the enterprise scenario, part of the problem, as I see it, is that if all or most of your development is geared around a browser at the client end, it isn't so much what the language does or doesn't give you in itself, but more about the tools and frameworks that are available for your chosen language. So often the ranters don't distinguish between the way Java enterprise solutions are created and the language they are created in. I have even seen Ajax used as a reason why Java is doomed. That is a weird view since I thought you can “do Ajax” in Java, but then what do I know? I wonder how many posts on non-Java sites there are praising Java? Not many I guess. Why? Because real Java developers  know they are on to a good thing and don't waste their time trying to convince “non believers”. The language is only as good as the people who use it! Enough said!</p>

<p>So from a lowly, part time, desktop bod to all you real Java developers I say ignore the trolls, let them get on with their latest “next best thing” you know you've already found it and its called <strong>Java</strong>.</p>

<p>Happy hacking,</p>

<p>Pete</p>]]>

</content>
</entry>
<entry>
<title>Projects Semplice, OpenOffice.org &amp; PaNaSeaM: Supporting classic VB.</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/panaseam/archive/2006/10/projects_sempli.html" />
<modified>2006-10-02T21:34:17Z</modified>
<issued>2006-10-02T21:34:05Z</issued>
<id>tag:weblogs.java.net,2006:/blog/panaseam/350.5667</id>
<created>2006-10-02T21:34:05Z</created>
<summary type="text/plain">A brief look at three different attempts at supporting classic VB code.
Semplice, OpenOffice &amp; PaNaSeaM.</summary>
<author>
<name>panaseam</name>

<email>pete.rickhayes@btinternet.com</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/panaseam/">
<![CDATA[<p>Earlier this year, at JavaOne, project <a href="http://blogs.sun.com/herbertc/entry/project_semplice_visual_basic_for">Semplice</a> was announced, the aim of which is to allow VB code to be compiled directly into Java bytecode. The development environment is an extension to Netbeans.</p>

<p>Prior to this, Novell has been working on a sub project of <a href="http://wiki.services.openoffice.org/wiki/VBA">OpenOffice.org</a> to allow VBA scripts embedded in documents to be executed directly in OpenOffice. This is not a Java solution although the extended, VB compatible API will presumably be accessible to Java through the Java UNO binding but the execution of the VB code will presumably be via extensions to the OOBasic interpreter built into OOo. It is unclear as to whether or not editing and debugging of VB code will be allowed.</p>

<p>There is also, a virtually unheard of java.net project, <a href="https://panaseam.dev.java.net/">panaseam</a>, that is also aimed at classic VB support using Java. This project uses the concept of conversion to Java, but attempts to maintain program semantics by emulating the VB runtime environment as closely as possible. Hence the converted code is recognizable when compared with the original.</p>

<p>In order to do anything with VB code in another environment you have to emulate the functionality of the core VB language engine. I do not know any details as to how Semplice or OOo are doing this. Presumably, as OOBasic is conceptually very similar to VB, extending the interpreter was not too difficult. With Semplice they are presumably doing the “conversion” in the compiler so that the JVM actually sees nothing but perfectly standard Java bytecode.</p>

<p>In order to avoid “surprises” for the end user it is very important to maintain total functional compatibility between the original and target environments. There are a few issues that they must have dealt with if the VB code is to run exactly as it did in the VB environment. I am not saying that they haven't dealt with these issues, but <strong>if</strong> they haven't there will be problems for the end user.</p>

<p>VB passes parameters by reference normally. Java ALWAYS passes by value. Not to be confused with passing a referent by value this is not the same thing at all. It means an object passed by reference can be replaced by a new object in the called procedure and this new object will also appear in the scope of the calling procedure. This works the same for primitives as well, but, thankfully, not for constants. Whilst using this functionality may be considered bad programming practice, in order to maintain 100% functional compatibility it needs to be implemented.</p>

<p>VB operator precedence is significantly different to Java. Good maintainable code should not rely on operator precedence however who said the VB code is going to be good?</p>

<p>VB has a “Static” declaration that causes procedure local variables to retain their values between calls. This is nothing like the static modifier in Java. This functionality is probably little used but again it needs to be implemented.</p>

<p>There are some legacy Basic elements in VB the worst ones are<br />
GoTo, GoSub, On .... GoTo etc. Unfortunately VB uses GoTo for error handling.<br />
If the error handling semantics are not accurately reproduced some very odd problems could arise.</p>

<p>VB file handling is a bit odd. When files are opened they are allocated a number and all references to that file use that number.</p>

<p><code>Open FileName for Output As #92 'Opens a file<br />
Print #92, Tab(12), "A bit of text" 'Writes some data to the file<br />
Close 92 'Closes the file<br />
Name FileName As NewFileName 'Rename the file<br />
</code><br />
Now it's not that difficult to emulate this behaviour but it's oddness must be accurately reproduced.</p>

<p>VB has a wonderful “data type” called a Variant which can contain anything you like or don't like come to that.</p>

<p>So all in all lots of fun!</p>

<p>Neither Semplice or OOo are attempting any sort of code conversion, One advantage of this approach is that you maintain interoperability with the original environment. Hence, particularly in the OpenOffice case, you could share documents that include macros between Windows, Mac and Linux users for example.</p>

<p>If, however, your only aim is unidirectional migration from a platform locked environment then retaining backward compatibility becomes moot.</p>

<p>I see the three projects as  primarily complimentary not competitive.<br />
Semplice is addressing continued support for standalone classic VB.<br />
OpenOffice is addressing interoperability in the office productivity environment.<br />
Panaseam is addressing VB to Java migration.</p>

<p>Yes panaseam overlaps the other two in the sense that it is taking a holistic approach to VB but it is certainly not a compiler and it is definitely not an office productivity suite.</p>

<p>One problem I see with both the Semplice and OOo approach is that if an end user hits a problem because either the compiler or runtime VB emulation, or whatever, is not quite right, they cannot do anything about it! All they have is VB code that doesn't work in the new environment. Even if both projects open source their work, Semplice will probably be deep JVM and compiler stuff, and OOo will all be implemented in C++ and UNO, neither of which is suitable for the likes of ex VB coders or even some Java coders  to unravel. So all the end user will be able to do is send a bug report and wait.</p>

<p>Also neither project appears designed for end users to directly add missing functionality.</p>

<p>The panaseam approach is via code conversion, coupled with an open source Java runtime environment that emulates the whole VB core language in Java. If the end user hits a problem due to a drop off in translation or runtime emulation, they can compare the translated code with the original to see if the program semantics have been messed up by the translator and they can also delve into the runtime environment, which will be pure Java, to see what is going wrong there. </p>

<p>Also as the environment will allow pluggable runtime modules to be used, the end user could even create their own tweaked version and simply plug it in place of the supplied module. It also means missing functionality can be added readily as it becomes available without having to be released as a complete update of the whole environment.</p>

<p>A big advantage for the Semplice and OOo projects is that they can choose to keep their solutions closed and as a result they won't expose themselves to copyright infringement claims and anyway they are under the umbrella of large organizations. Yes I know closed source would be a problem for OpenOffice but at the moment the VBA extensions are still being developed by Novell and could be released as a closed source add on.</p>

<p>The panaseam project has already proved that the concept works but has hit a “slight” problem.<br />
In order to go any further and turn panaseam into a production usable system it means creating and publishing the entire VB and core MSOffice APIs re-defined in Java. As a lone developer I have no financial or legal support so if I publish and Microsoft decide I have infringed their IP, I could be flattened.</p>

<p>That leads me neatly on to the next part of my blog IPvIP Part2: Is a Java interface copyright protected?</p>

<p>Happy hacking<br />
Pete</p>]]>

</content>
</entry>
<entry>
<title>IP v IP. (Intellectual Property versus Innovation Protection) Part 1: Courts and Coders</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/panaseam/archive/2006/09/ip_v_ip_intelle.html" />
<modified>2006-09-27T21:44:16Z</modified>
<issued>2006-09-27T21:44:08Z</issued>
<id>tag:weblogs.java.net,2006:/blog/panaseam/350.5643</id>
<created>2006-09-27T21:44:08Z</created>
<summary type="text/plain">Pete Morgan attempts to raise Java programmers awareness of legal issues facing open source projects. Particularly the &quot;small guy&quot;</summary>
<author>
<name>panaseam</name>

<email>pete.rickhayes@btinternet.com</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/panaseam/">
<![CDATA[<p>There are numerous small open source projects hosted on java.net and whilst this post, in itself, is not Java specific it is as the owner of one of those small projects that I voice my concerns!</p>

<p>It's a reasonable guess that many programmers find legal stuff boring as hell and as far as possible ignore it. Unfortunately in this world of patents and copyrights it could be only too easy for an ordinary open source coder to fall foul of alleged intellectual property infringement. Ignoring the legalities is not an option, in the eye of the law "Ignorance is no defense". Also complacency is anti-innovative and therefore unacceptable.</p>

<p>If you program in a purely commercial environment you may feel legal issues don't affect you, but if you use any open source software at all then you should at least consider how legalities could affect that software and its future availability.</p>

<p><strong>Just to make a point consider this scenario</strong>:</p>

<p>I have a project hosted on java.net.<br />
I upload some code and make an announcement telling all the world how clever it is.</p>

<p><strong>Now here's the essence of the problem</strong>:<br />
I wrote the code in the UK but it is hosted on an American server. What jurisdiction does it fall under?<br />
This code is visible anywhere in the world that can be accessed via the internet.<br />
Can I be 100% sure my code doesn't infringe somebody's IP according to my own country's laws?<br />
Worse how do I know it doesn't infringe someone's IP according to some other country's law?<br />
Even worse, what if someone wants to stop me from continuing my development because they perceive a commercial threat to their own products? If they have enough money they can simply sue me in a country of their choosing on some dubious grounds knowing that it is unlikely I can possibly afford to defend myself. So I'm then left with the choice of disbanding my project, with the hope that they withdraw the lawsuit or risk having the court rule against me, levying some ludicrous fine and basically preventing me from ever going to that country for fear of being arrested for non-payment of that fine. At least if I got sued in my own Country I may be able to attempt to defend myself, although the likely outcome of that is far from promising even if I am genuinely innocent.</p>

<p><strong>Far fetched isn't it?</strong></p>

<p>Unfortunately not! (apart from the implication that I could ever write some clever code)</p>

<p>As an example of what can happen, although not IP related, consider UK based anti spam company Spamhaus being taken to court in Chicago [ <a href="http://arstechnica.com/news.ars/post/20060915-7757.html">http://arstechnica.com/news.ars/post/20060915-7757.html</a> ].<br />
Although Spamhaus could have probably won the case, they chose not to defend themselves and got heavily fined. Since a US court has no jurisdiction in the UK, Spamhaus can avoid paying the fine but will it's directors ever be able to visit the US without fear of being arrested? This happened in a US court but it could happen anywhere. Is this justice?<br />
[ <a href="http://en.wikipedia.org/wiki/Justice">http://en.wikipedia.org/wiki/Justice</a> ]<br />
 <br />
If something like this happened to me it might mean I'd never be able to meet Mickey, Minnie, Donald and Goofy again, not to mention missing out on $3.99 breakfast buffets and 7.5 ounce choc chip sandwich ice creams. Now <strong>that is serious!</strong></p>

<p>The problem is that legal systems don't prevent you being sued even when you haven't done anything wrong. Consider SCO v IBM. Even though this case involves two large companies rather than large versus tiny, which is my real concern, it still shows how a business with enough money can launch a lawsuit against anyone on pretty tenuous grounds. There is also a far more sinister undertone in the popular belief that SCO were in fact "put up to" the action by a third party.</p>

<p>Anyway, whether or not these cases are relevant, my point is that the patent/copyright jungle is a nightmare for ordinary hackers to even begin to cope with. Larger projects and especially commercially supported ones probably have the resources to at least give a supportive legal umbrella for its members. Any of us working alone or in small groups have no support whatsoever.</p>

<p>Remember that open source is making it in the big league, some of the existing big league players could get seriously worried about losing their position and the money that goes with it. They will stop at nothing to maintain that position, these guys play dirty and enjoy bullying little guys so beware, things could get very nasty!</p>

<p>One possible solution is to try to get your own ideas accepted as a sub project of an existing large commercially supported project. Even this could be problematic. Who do you contact? Do you send a detailed description or even source code to someone you don't even know? Remember, in this scenario, you probably haven't even published your work so if they chose to they could claim it as their own and you, an unknown outsider, wouldn't stand a chance of convincing anyone of the truth. Of course they could simply tell you your idea is rubbish because they genuinely think it is, or even because they think it could undermine their own cherished ideas. I know it sounds a very dark picture to paint but history is full of stories of people being fleeced, even Walt Disney got ripped off before he created Mickey Mouse. </p>

<p>Innovation and the right to innovate do not just belong in the hands of the rich and powerful. It is no good pretending that innovation only occurs in large corporate environments. The beauty of computer programming, particularly in the Java environment, is that pretty well anyone can join in and innovate with minimal resources. The problem is that such individuals are potentially wide open to abuse by anyone with the money to employ a lawyer.</p>

<p>You could point out that even in this hostile environment there have been plenty of successfully exploited innovations and many more will occur. But how many innovations have failed or been lost because of it? Taking the lame view that "it's always been like that" is simply not acceptable it is anti-innovative.</p>

<p><strong>So to conclude</strong>:<br />
If the companies that claim to support open source really want open source innovation to continue at all levels, not just in their own pet projects, then they should seriously consider setting up some sort of legal support service to at least give helpful advice to open source projects. An international facility primarily funded by interested corporations with an affordable membership fee for bona fide developers would be a good start.</p>

<p>There is one organization that is along the right lines, namely New York based Software Freedom Law Center<br />
[ <a href="http://www.softwarefreedom.org/index.html">http://www.softwarefreedom.org/index.html</a> ]. Perhaps, with sufficient funding, they could form the core of a global facility.</p>

<p>Anybody got any thoughts or suggestions?</p>

<p>Comments containing "sucks" and "go away you boring old fart" will be considered "off topic" and the poster should be "sued for every penny they have", although I have a preference for $100 bills myself.:).</p>

<p>Sorry but there will be a follow up<br />
Part 2: Is a Java interface copyright protected?</p>

<p>To anyone that read this far, thanks for your time.</p>

<p>Happy hacking,<br />
Pete</p>]]>

</content>
</entry>

</feed>