showhideactionhandler.java

来自「Java生成PDF Java生成PDF Java生成PDF」· Java 代码 · 共 43 行

JAVA
43
字号
// $Id: ShowHideActionHandler.java,v 1.7 2007/09/12 10:04:59 mike Exp $package org.faceless.pdf2.viewer2.feature;import org.faceless.pdf2.viewer2.*;import org.faceless.pdf2.*;import javax.swing.*;import java.awt.event.*;/** * Handles the "ShowWidget" and "HideWidget" types of {@link PDFAction}. * The name of this feature is "ShowHideActionHandler". * <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 ShowHideActionHandler extends ActionHandler{    private static ShowHideActionHandler instance;        /**     * Return the ShowHideActionHandler     */    public static ShowHideActionHandler getInstance() {        if (instance==null) instance = new ShowHideActionHandler();        return instance;    }    private ShowHideActionHandler() {        super("ShowHideActionHandler");    }    public boolean matches(DocumentPanel panel, PDFAction action) {        String type = action.getType();        return type.equals("ShowWidget") || type.equals("HideWidget");    }    public void run(DocumentPanel docpanel, PDFAction action) {        WidgetAnnotation annot = action.getAnnotation();        annot.setVisible(action.getType().equals("ShowWidget"));        docpanel.redraw(annot);    }}

⌨️ 快捷键说明

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