/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info: http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2007, by :
* Corporate:
* EADS Astrium
* Individual:
* Claude Cazenave
*
* $Id: Java3dPlugin.java,v 1.4 2008/10/02 11:18:12 cazenave Exp $
*
* Changes
* -------
* 4 janv. 08 : Initial public release
*
*/
package jsynoptic.plugins.java3d;
import javax.swing.JScrollPane;
import jsynoptic.base.Plugin;
import jsynoptic.plugins.java3d.tree.Tree;
import simtools.diagram.DiagramComponent;
import simtools.shapes.AbstractShape;
import simtools.ui.NamedElementContainer;
public class Java3dPlugin extends Plugin {
public static final String _3DShape = "3D Shape";
protected static final String NAME = "Java 3D"; // TODO i18n
Tree _tree;
public Java3dPlugin() {
}
@Override
public AbstractShape createShape(String name, DiagramComponent diagram) {
if (name.equals(_3DShape)) {
return new Java3dShape(0, 0, 250, 250, UniversePool.getGlobal().getCurrentUniverse());
}
return null;
}
@Override
public String[] getShapes() {
String[] res = { _3DShape };
return res;
}
@Override
public void newSourceComponent(NamedElementContainer c) {
if (_tree == null) {
_tree = new Tree(UniversePool.getGlobal(),this);
JScrollPane sp = new JScrollPane(_tree);
c.addElement(sp, NAME);
}
}
}