svgeditormain.java~2~

来自「完全基于java开发的svg矢量绘图工具」· JAVA~2~ 代码 · 共 65 行

JAVA~2~
65
字号
package fr.itris.glips.svgeditor;

import java.awt.event.*;
import javax.swing.*;
import fr.itris.glips.svgeditor.resources.*;

/**
 * the enter point of the application
 * @author Jordi SUC
 */
public class SVGEditorMain {

  /**
   * the constructor of the class
   *@param fileName the name of a svg file
   */
  public SVGEditorMain(String fileName) {

    //creating the editor object
    final SVGEditor editor = new SVGEditor();

    //creating the parent frame of the editor
    JFrame mainFrame = new JFrame();
    mainFrame.setTitle("GLIPS Graffiti Editor");

    //handling the close case
    mainFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    mainFrame.addWindowListener(new WindowAdapter() {

      @Override
      public void windowClosing(WindowEvent evt) {

        editor.exit();
      }
    });

    //setting the icon
    ImageIcon icon2 = SVGResource.getIcon("Editor", false);

    if (icon2 != null && icon2.getImage() != null) {

      mainFrame.setIconImage(icon2.getImage());
    }

    //intializing the editor
    editor.init(mainFrame, fileName, true, true, false, true, null);
  }

  /**
   * the main method
   * @param args the array of arguments
   */
  public static void main(String[] args) {

    String fileName = "";

    if (args != null && args.length > 0) {

      fileName = args[0];
    }

    new SVGEditorMain(fileName);
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?