Example usage for com.itextpdf.text PageSize EXECUTIVE

List of usage examples for com.itextpdf.text PageSize EXECUTIVE

Introduction

In this page you can find the example usage for com.itextpdf.text PageSize EXECUTIVE.

Prototype

Rectangle EXECUTIVE

To view the source code for com.itextpdf.text PageSize EXECUTIVE.

Click Source Link

Document

This is the executive format

Usage

From source file:org.fhaes.neofhchart.PDFExportOptionsDialog.java

License:Open Source License

/**
 * Handles when actions are performed on the dialog.
 *//*from w  w  w .  j a  v a  2  s  .  c o  m*/
@Override
public void actionPerformed(ActionEvent evt) {

    if (evt.getActionCommand().equals("OK")) {
        // Perform the export operation
        boolean completedSuccessfully = doExportToPDF();

        if (completedSuccessfully) {
            MainWindow.getInstance().getFeedbackMessagePanel().updateFeedbackMessage(FeedbackMessageType.INFO,
                    FeedbackDisplayProtocol.AUTO_HIDE,
                    FeedbackDictionary.NEOFHCHART_PDF_EXPORT_MESSAGE.toString());
        } else {
            MainWindow.getInstance().getFeedbackMessagePanel().updateFeedbackMessage(FeedbackMessageType.ERROR,
                    FeedbackDisplayProtocol.MANUAL_HIDE,
                    "An error occured while attempting to export chart as PDF.");
        }

        this.dispose();
    } else if (evt.getActionCommand().equals("Cancel")) {
        // Close the dialog
        this.dispose();
    } else if (evt.getActionCommand().equals("PaperSize")) {
        // Update the paper size label
        if (this.cboPaperSize.getSelectedItem() instanceof Rectangle) {
            Object value = this.cboPaperSize.getSelectedItem();
            if (value.equals(PageSize.A5)) {
                this.lblSize.setText("148 x 210mm  /  5.83 x 8.27\"");
            } else if (value.equals(PageSize.A4)) {
                this.lblSize.setText("210 x 297mm  /  8.27 x 11.7\"");
            } else if (value.equals(PageSize.A3)) {
                this.lblSize.setText("297 x 420mm  /  11.7 x 16.5\"");
            } else if (value.equals(PageSize.A2)) {
                this.lblSize.setText("420 x 594mm  /  16.5 x 23.4\"");
            } else if (value.equals(PageSize.A1)) {
                this.lblSize.setText("594 x 841mm  /  23.4 x 33.1\"");
            } else if (value.equals(PageSize.A0)) {
                this.lblSize.setText("841 x 1189mm  /  33.1 x 46.8\"");
            } else if (value.equals(PageSize.LETTER)) {
                this.lblSize.setText("215.9 x 279.4mm  /  8.5 x 11\"");
            } else if (value.equals(PageSize.LEGAL)) {
                this.lblSize.setText("215.9 x 355.6mm  /  8.5 x 14\"");
            } else if (value.equals(PageSize.EXECUTIVE)) {
                this.lblSize.setText("184 x 267mm  /  7.25 x 10.5\"");
            } else {
                this.lblSize.setText("");
            }

            radLandscape.setEnabled(true);
            radPortrait.setEnabled(true);
        } else {
            this.lblSize.setText("");
            radLandscape.setEnabled(false);
            radPortrait.setEnabled(false);
        }
    }
}