octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opportunities for core work on Java


From: Rik
Subject: Opportunities for core work on Java
Date: Fri, 14 Dec 2012 11:03:29 -0800

12/14/12

All,

For anyone who is interested in doing a little core development, but has
been reluctant because it looks daunting, there are a number of bite-size
tasks that are available.

1) javaclasspath.m needs to be able to set the classpath.

Currently the Octave version of javaclasspath only reads the current
classpath variable.  For compatibility, and because it makes sense, we
should be able to call javaclasspath (dpath) and directly set the value of
the classpath.  The functionality we are trying to match is here
(http://www.mathworks.com/help/matlab/ref/javaclasspath.html).  The change
is pretty simple as well, call javaMethod with a "setProperty" method
instead of a "getProperty" method.  Watch out that the path to octave.jar
should always remain as the first element of the classpath.

 javaMethod ("getProperty", "java.lang.System", "java.class.path")
    =>
 javaMethod ("setProperty", "java.lang.System", "java.class.path", dpath)

2) javaaddpath.m needs to support prepending as well as appending a path to
the classpath variable.

Currently, javaaadpath always appends which is the equivalent of the '-end'
option.  The functionality to match is
http://www.mathworks.com/help/matlab/ref/javaaddpath.html.  Maybe wait on
this item until item #1 is done and then this will become very easy.

3) im2java.m for conversion between Octave and Java image formats.

The functionality to match is
http://www.mathworks.com/help/matlab/ref/im2java.html.  The java format to
match is that of java.awt.Image.  The Octave side has ind2rgb which will
get the image in close to the correct format.

4) Need %!demo blocks for dialog functions

There is a seperate m-file, scripts/java/dlgtest.m, which contains
demonstrations of the different dialog boxes.  This should be broken up and
the code put at the bottom of each relevant m-file such as errordlg.m or
questdlg.m.  Demo blocks begin with %!demo and begin 2 lines below
'endfunction'.  Once the demo blocks have been created dlgtest.m can be
removed.

5) %!test blocks needed for java functions

The java functions need tests written for them.  The test code is at the
end of each m-file and should begin with '%!testif HAVE_JAVA' if it uses
Java.  It can begin with '%!test' if it is an ordinary test block that
might be checking just input validation.  There are functions in
libinterp/octave-value/ov-java.cc which also need test blocks.  In the C++
code the test blocks need to be inside of block comments immediately after
the DEFUN block.  For example, a totally simple test for the isjava()
function is:

/*
%!testif HAVE_JAVA
%! jobj = javaObject ("java.lang.StringBuffer");
%! assert (isjava (jobj));
*/

--Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]