filesave.java

来自「用JGraph编的软件」· Java 代码 · 共 42 行

JAVA
42
字号
package org.jgraph.pad.actions;

import java.awt.event.ActionEvent;
import java.net.URL;

import org.jgraph.GPGraphpad;
import org.jgraph.pad.GPDocument;
import org.jgraph.pad.GPGraph;

/**
 * Action opens a dialog to select the file.
 * After that the action saves the current graph to
 * the selected file.
 *
 * @author sven.luzar
 *
 */
public class FileSave extends AbstractActionFile {

	/**
	 * Constructor for FileSave.
	 * @param graphpad
	 * @param name
	 */
	public FileSave(GPGraphpad graphpad)
	{
		super(graphpad);
	}

	/** Invokes the export model save function(s)
	 */
	public void actionPerformed(ActionEvent e)
	{
		GPDocument doc = getCurrentDocument();
		URL filename = doc.getFilename();
		GPGraph gpGraph = doc.getGraph();

		doc.getExportModel().saveFile( graphpad, doc, filename, gpGraph);
	}

}

⌨️ 快捷键说明

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