documentpanelevent.java
来自「Java生成PDF Java生成PDF Java生成PDF」· Java 代码 · 共 78 行
JAVA
78 行
// $Id: DocumentPanelEvent.java,v 1.7 2007/05/21 15:02:59 mike Exp $package org.faceless.pdf2.viewer2;import java.awt.event.*;import java.awt.*;import javax.swing.*;import org.faceless.pdf2.*;/** * Represents an event on a {@link DocumentPanel} indicating that document has changed * somehow. To capture these events, implement the {@link DocumentPanelListener} interface * and register via the {@link DocumentPanel#addDocumentPanelListener DocumentPanel.addDocumentPanelListener()} method. * Be sure to check the {@link #getType} method to see what sort of event it is - current values * include: * <table class="defntable"> * <tr><th>created</th><td>Raised when the DocumentPanel is first created</code></td></tr> * <tr><th>activated</th><td>Raised when the DocumentPanel is activated with a valid PDF</code></td></tr> * <tr><th>deactivated</th><td>Raised when the DocumentPanel is deactivated</code></td></tr> * <tr><th>viewportChanged</th><td>Raised when the DocumentPanel has a new {@link DocumentViewport} applied to it</code></td></tr> * <tr><th>loaded</th><td>Raised after a PDF is loaded</code></td></tr> * <tr><th>closing</th><td>Raised when the PDF is closing</code></td></tr> * <tr><th>redrawn</th><td>Raised when the PDF has been redrawn somehow</code></td></tr> * </table> * <p><i>This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.</i></p> * @since 2.8 */public class DocumentPanelEvent{ private final DocumentPanel panel; private final String type; static DocumentPanelEvent createCreated(DocumentPanel panel) { return new DocumentPanelEvent("created", panel); } static DocumentPanelEvent createActivated(DocumentPanel panel) { return new DocumentPanelEvent("activated", panel); } static DocumentPanelEvent createDeactivated(DocumentPanel panel) { return new DocumentPanelEvent("deactivated", panel); } static DocumentPanelEvent createViewportChanged(DocumentPanel panel) { return new DocumentPanelEvent("viewportChanged", panel); } static DocumentPanelEvent createLoaded(DocumentPanel panel) { return new DocumentPanelEvent("loaded", panel); } static DocumentPanelEvent createClosing(DocumentPanel panel) { return new DocumentPanelEvent("closing", panel); } static DocumentPanelEvent createRedraw(DocumentPanel panel) { return new DocumentPanelEvent("redrawn", panel); } private DocumentPanelEvent(String type, DocumentPanel panel) { this.type = type; this.panel = panel; } public String toString() { return "[D:"+type+"]"; } /** * Get the DocumentPanel this event was raised on */ public DocumentPanel getDocumentPanel() { return panel; } /** * Get the type of the DocumentPanelEvent */ public String getType() { return type; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?