All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpedal.examples.viewer.commands.Continuous Maven / Gradle / Ivy

There is a newer version: 7.15.25
Show newest version
/*
 * ===========================================
 * Java Pdf Extraction Decoding Access Library
 * ===========================================
 *
 * Project Info:  http://www.idrsolutions.com
 * Help section for developers at http://www.idrsolutions.com/support/
 *
 * (C) Copyright 1997-2017 IDRsolutions and Contributors.
 *
 * This file is part of JPedal/JPDF2HTML5
 *
 @LICENSE@
 *
 * ---------------
 * Continuous.java
 * ---------------
 */
package org.jpedal.examples.viewer.commands;

import java.awt.Component;

import org.jpedal.PdfDecoderInt;
import org.jpedal.display.Display;
import org.jpedal.examples.viewer.Commands;
import org.jpedal.examples.viewer.SharedViewer;
import org.jpedal.gui.GUIFactory;

/**
 * Change page display mode to continuous
 */
public class Continuous {

    public static void execute(final PdfDecoderInt decode_pdf, final GUIFactory currentGUI, final Object[] args) {
        if (!decode_pdf.isOpen() || decode_pdf.getDisplayView() == Display.CONTINUOUS) {
            return;
        }

        if (args == null) {

            currentGUI.getCombo(Commands.SCALING).setEnabled(true);
            currentGUI.getCombo(Commands.ROTATION).setEnabled(true);

            currentGUI.getButtons().getButton(Commands.ROTATELEFT).setEnabled(true);
            currentGUI.getButtons().getButton(Commands.ROTATERIGHT).setEnabled(true);

            if (currentGUI.getGlassPane() != null) {
                ((Component) currentGUI.getGlassPane()).setVisible(true);
            }

            currentGUI.getButtons().getButton(Commands.MOUSEMODE).setEnabled(true);
            currentGUI.getButtons().getButton(Commands.SNAPSHOT).setEnabled(true);

            currentGUI.getButtons().alignLayoutMenuOption(Display.CONTINUOUS);

            if (SharedViewer.isFX()) {
                ModeChange.changeModeInJavaFX(Display.CONTINUOUS, decode_pdf, currentGUI);
            } else {
                ModeChange.changeModeInSwing(Display.CONTINUOUS, decode_pdf, currentGUI, null);
            }
            currentGUI.updateTextBoxSize();
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy