⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visioeventadapter.java

📁 Very Nice library for using ActiveX controls directly from java without heavy knowledge of JNI, simp
💻 JAVA
字号:
package com.jacob.samples.visio;

import com.jacob.com.Variant;

/**
 * Created as part of sourceforge 1386454 to demonstrate returning values in
 * event handlers
 * 
 * @author miles@rowansoftware.net
 * 
 * You can subclass this class and only implement the methods you're interested
 * in
 */
public class VisioEventAdapter implements VisioEventListener {

	VisioApp app = null;

	public VisioEventAdapter(VisioApp pApp) {
		app = pApp;
		System.out.println("Event listener constructed");
	}

	public void BeforeQuit(Variant[] args) {
	}

	public void DocumentChanged(Variant[] args) {
		System.out.println("documentChanged()");
	}

	public void DocumentCloseCanceled(Variant[] args) {
	}

	public void DocumentCreated(Variant[] args) {
	}

	public void DocumentOpened(Variant[] args) {
		System.out.println("DocumentOpened()");
	}

	public void DocumentSaved(Variant[] args) {
	}

	public void DocumentSavedAs(Variant[] args) {
	}

	public Variant QueryCancelDocumentClose(Variant[] args) {
		System.out.println("QueryCancelDocumentClose()");
		return new Variant(false);
	}

	/**
	 * we don't actually let it quit. We block it so that we don't have to
	 * relaunch when we look at a new document
	 */
	public Variant QueryCancelQuit(Variant[] args) {
		// these may throw VisioException
		System.out
				.println("Saving document, hiding and telling visio not to quit");
		try {
			app.save();
			app.setVisible(false);
		} catch (VisioException ve) {
			System.out.println("ailed to openFile()");
			ve.printStackTrace();
		}
		return new Variant(true);
	}
}

⌨️ 快捷键说明

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