Example usage for org.jfree.ui RefineryUtilities centerDialogInParent

List of usage examples for org.jfree.ui RefineryUtilities centerDialogInParent

Introduction

In this page you can find the example usage for org.jfree.ui RefineryUtilities centerDialogInParent.

Prototype

public static void centerDialogInParent(final Dialog dialog) 

Source Link

Document

Positions the specified dialog within its parent.

Usage

From source file:com.prezerak.windmill.gui.AveragesPanel.java

public void update() {
    waitDlg = new WaitDialog();
    Thread t = new Thread(this);
    t.start();/*  ww w .ja va 2 s  .c om*/
    RefineryUtilities.centerDialogInParent(waitDlg);
    waitDlg.setVisible(true);
}

From source file:org.pentaho.platform.plugin.action.jfreereport.JFreeReportComponent.java

protected boolean writeSwingPreview(final MasterReport report) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();

    final boolean progressBar = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR,
            "true".equals( //$NON-NLS-1$
                    reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY)));
    final boolean progressDialog = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG,
            "true".equals( //$NON-NLS-1$
                    reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY)));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY,
            String.valueOf(progressDialog));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY,
            String.valueOf(progressBar));

    final PreviewDialog dialog = createDialog(report);
    final ReportController reportController = getReportController();
    if (reportController != null) {
        dialog.setReportController(reportController);
    }//  ww  w .j  a va2  s  . c  om
    dialog.pack();
    if (dialog.getParent() != null) {
        RefineryUtilities.centerDialogInParent(dialog);
    } else {
        RefineryUtilities.centerFrameOnScreen(dialog);
    }

    dialog.setVisible(true);
    return true;
}