
darwin.core.gui.ClientApplet Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2012 daniel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package darwin.core.gui;
//import netscape.javascript.JSException;
//import netscape.javascript.JSObject;
import java.awt.BorderLayout;
import com.jogamp.newt.awt.NewtCanvasAWT;
import javax.swing.JApplet;
//TODO JS funktionalitaet wiederherstellen, umstieg auf Rhino(OpenJDK7)
/**
*
** @author Daniel Heinrich
*/
@SuppressWarnings("serial")
public class ClientApplet extends JApplet implements ShutdownListener
{
private Client client;
@Override
public void init()
{
client = Client.createClient();
client.addShutdownListener(this);
setLayout(new BorderLayout());
}
@Override
public void start()
{
try {
client.iniClient();
NewtCanvasAWT canvas = new NewtCanvasAWT(client.getWindow());
add(canvas, BorderLayout.CENTER);
} catch (InstantiationException ex) {
doShutDown();
}
}
@Override
public void stop()
{
doShutDown();
}
@Override
public void doShutDown()
{
client.shutdown();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy