Plots and Events with Javasci
sunKar
maitreyakara at yahoo.com
Fri Mar 23 22:11:45 CET 2012
I am new to using Scilab from Java. I am trying to invoke plot3d and plot2d
functions from a Java program. I am currently using Scilab 5.4.0 alpha1. I
modified the deprecated ExampleEvents code in the Examples subfolder of
javasci. But the program quits without setting up a plot.
The Scilab class does not have Events() method to sense the events in the
graphic window. I commented it out (May be I should capture the events using
Scilab functions?). The program ends without setting up window.
Here is the modified code:
import org.scilab.modules.javasci.Scilab;
class ExampleEvents{
public static void main(String[] args) throws Exception
{
Scilab sci = new Scilab();
if (sci.open()) {
int i=0;
sci.exec("plot3d();");
while (sci.isGraphicOpened()!=false)
{
// sci.Events();
try
{
Thread.sleep( 100 );
}
catch ( InterruptedException e )
{
}
System.out.println("Java loop "+i);
i++;
}
System.out.println("Graphics window closed");
sci.close();
} else {
System.out.println("Could not start Scilab ");
}
}
}
How do I correct it to display the graphics window?
Thanks,
Karuna
--
View this message in context: http://mailinglists.scilab.org/Plots-and-Events-with-Javasci-tp3852799p3852799.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
More information about the users
mailing list