Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Java diff viewer Component?

Thread view: 
Rogan Dawes - 30 Nov 2005 07:38 GMT
Hi folks,

I'm looking for a Swing Component that can display differences between
two files/streams/char arrays side by side, preferably with colour
highlighting.

Remarkably, it seems that such a thing is hard to come by, along with
Java implementations of various diff algorithms.

Any ideas?

For reference purposes, I have looked at implementing the Levenshtein
distance algorithm, as well as investigated ports of the GNU diff algo
to Java. These are both options, of course.

However, I guess that the diff algorithm would probably be dictated by
the diff viewer Component, so I'm not going too far in that direction yet.

License should preferably be GPL compatible, if at all possible.

Thanks for any suggestions.

Rogan.

P.S. The most obvious search result (JDiff) provides reports on the
differences between versions of the Java API :-( Not quite what I was
looking for.
Jeffrey Schwab - 30 Nov 2005 15:51 GMT
> Hi folks,
>
[quoted text clipped - 23 lines]
> differences between versions of the Java API :-( Not quite what I was
> looking for.

I've played with this before, but I didn't get to use it my own work
because of its GPL:

    http://www.bmsi.com/java/#diff

Send the output to the textual display component of your choice.
Rogan Dawes - 01 Dec 2005 12:57 GMT
>> Hi folks,
>>
[quoted text clipped - 10 lines]
>> distance algorithm, as well as investigated ports of the GNU diff algo
>> to Java. These are both options, of course.

[snip]

> I've played with this before, but I didn't get to use it my own work
> because of its GPL:
>
>     http://www.bmsi.com/java/#diff
>
> Send the output to the textual display component of your choice.

Thanks for the response. I had also encountered that version, which is,
IIRC, a port of the gnu diff sources.

Rogan
Rogan Dawes - 05 Dec 2005 11:48 GMT
> Hi folks,
>
[quoted text clipped - 10 lines]
> distance algorithm, as well as investigated ports of the GNU diff
> algo to Java. These are both options, of course.

Well, I gave up, and implemented one myself, based on the incava.org
Diff implementation.

You can take a look at it at:

(For the Diff sources)
<http://dawes.za.net/gitweb.cgi?p=dawes.za.net/webscarab.git;a=tree;h=148dc26a7ff
3ef6ff5ddc35b206d5f9f60a30489;hb=7fc5807cc8391a080d18d081edaf745ea1f3a963;f=src/
org/incava/util/diff
>
and
(for the DiffPanel sources)
<http://dawes.za.net/gitweb.cgi?p=dawes.za.net/webscarab.git;a=tree;h=f6b756fbe78
c6f1be21a00cffbee5e904a0efcd9;hb=7fc5807cc8391a080d18d081edaf745ea1f3a963;f=src/
org/incava/util/diff/swing
>

It needs some tweaking to improve configurability (e.g. the colours for
highlighting, etc), but it is reasonably usable as is.

Feedback appreciated.

Rogan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.