Package jsynoptic.plugins.svg

Source Code of jsynoptic.plugins.svg.SvgPlugin

/* ========================
* 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-2006, by :
*     Corporate:
*         EADS Astrium SAS
*     Individual:
*         Mathias Choquet
*
*
* $$Id$$
*
*/
package jsynoptic.plugins.svg;

import java.util.ArrayList;
import java.util.List;

import jsynoptic.base.Plugin;
import jsynoptic.ui.ShapeCreator;
import simtools.shapes.AbstractShape;
import simtools.ui.MenuResourceBundle;
import simtools.ui.ResourceFinder;

/**
* A plugin to enable SvgShape
*/
public class SvgPlugin extends Plugin {

  public static MenuResourceBundle resources = ResourceFinder.getMenu(SvgPlugin.class);
 
 
  protected List shapeCreators;
  public final static String SVG_SHAPE=resources.getString("SvgShape");
   
  public SvgPlugin(){
      shapeCreators = new ArrayList();
        shapeCreators.add(new ShapeCreator(this, SVG_SHAPE));
  }

    /* (non-Javadoc)
     * @see jsynoptic.base.Plugin#getShapeCreators()
     */
    public List getShapeCreators(){
        return shapeCreators;
    }


  /**
   * Method <b>createSvgShape</b>
   * static method to create a SvgShape
   * Parameters:
   * @param diagram
   * @return the shape
   */
  public static AbstractShape createSvgShape() {
      return new SvgShape(0, 0,100,100);
  }
 
 

  /* (non-Javadoc)
   * @see jsynoptic.base.Plugin#createShape(java.lang.String)
   */
  public AbstractShape createShape(String name) {
      AbstractShape res = null;

      if (name.equals(SVG_SHAPE)){
          res =  createSvgShape();
      }
      return res;
  }
   
    /**
     * Enter your plugin information here. This will appear in the about box.
     * Warning : uses HTML... @see jsynoptic.base.Plugin#about()
     */
    public String about() {
        return resources.getString("about");
    }
}
TOP

Related Classes of jsynoptic.plugins.svg.SvgPlugin

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.