private void alignElements(final PageDefinition original)
{
final Component parent = getReportDesignerContext().getView().getParent();
final Window window = LibSwingUtil.getWindowAncestor(parent);
final AlignmentOptionsDialog dialog;
if (window instanceof JDialog)
{
dialog = new AlignmentOptionsDialog((JDialog) window, getActiveContext(), original);
}
else if (window instanceof JFrame)
{
dialog = new AlignmentOptionsDialog((JFrame) window, getActiveContext(), original);
}
else
{
dialog = new AlignmentOptionsDialog(getActiveContext(), original);
}
dialog.performEdit();
}