diff options
author | Tore Engvig <tore@apache.org> | 2001-07-30 20:29:35 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-07-30 20:29:35 +0000 |
commit | e0edd215721150e6c04ac49706622d6189cb0b42 (patch) | |
tree | 6b59b872d9c0e93f99316ea2f421209b71a97755 /src/org/apache/fop/viewer/GoToPageDialog.java | |
parent | eb57915dec9bcd907e495595efac60dbf3579ad8 (diff) | |
download | xmlgraphics-fop-e0edd215721150e6c04ac49706622d6189cb0b42.tar.gz xmlgraphics-fop-e0edd215721150e6c04ac49706622d6189cb0b42.zip |
Formatted code according to code standards.
Changed license to use short license.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/viewer/GoToPageDialog.java')
-rw-r--r-- | src/org/apache/fop/viewer/GoToPageDialog.java | 162 |
1 files changed, 92 insertions, 70 deletions
diff --git a/src/org/apache/fop/viewer/GoToPageDialog.java b/src/org/apache/fop/viewer/GoToPageDialog.java index c5b1f4198..f5bce3f66 100644 --- a/src/org/apache/fop/viewer/GoToPageDialog.java +++ b/src/org/apache/fop/viewer/GoToPageDialog.java @@ -1,8 +1,15 @@ /* - originally contributed by - Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +/* + * originally contributed by + * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com */ package org.apache.fop.viewer; @@ -14,75 +21,90 @@ import java.awt.event.*; import org.apache.fop.messaging.MessageHandler; public class GoToPageDialog extends JDialog { - JPanel panel1 = new JPanel(); - GridBagLayout gridBagLayout1 = new GridBagLayout(); - JLabel pgNbLabel = new JLabel(); - JTextField pgNbField = new JTextField(); - JButton okButton = new JButton(); - JButton cancelButton = new JButton(); - - int pageNumber = -1; - - public GoToPageDialog(Frame frame, String title, boolean modal) { - super(frame, title, modal); - try { - jbInit(); - pack(); + JPanel panel1 = new JPanel(); + GridBagLayout gridBagLayout1 = new GridBagLayout(); + JLabel pgNbLabel = new JLabel(); + JTextField pgNbField = new JTextField(); + JButton okButton = new JButton(); + JButton cancelButton = new JButton(); + + int pageNumber = -1; + + public GoToPageDialog(Frame frame, String title, boolean modal) { + super(frame, title, modal); + try { + jbInit(); + pack(); + } catch (Exception ex) { + MessageHandler.errorln("GoToPageDialog: Konstruktor: " + + ex.getMessage()); + } + } + + public GoToPageDialog() { + this(null, "", false); } - catch(Exception ex) { - MessageHandler.errorln("GoToPageDialog: Konstruktor: " + ex.getMessage()); + + void jbInit() throws Exception { + panel1.setLayout(gridBagLayout1); + pgNbLabel.setText("Page number"); + okButton.setText("Ok"); + okButton.addActionListener(new java.awt.event.ActionListener() { + + public void actionPerformed(ActionEvent e) { + okButton_actionPerformed(e); + } + + }); + cancelButton.setText("Cancel"); + cancelButton.addActionListener(new java.awt.event.ActionListener() { + + public void actionPerformed(ActionEvent e) { + cancelButton_actionPerformed(e); + } + + }); + panel1.setMinimumSize(new Dimension(250, 78)); + getContentPane().add(panel1); + panel1.add(pgNbLabel, + new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.WEST, + GridBagConstraints.NONE, + new Insets(10, 10, 10, 5), 0, 0)); + panel1.add(pgNbField, + new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, + GridBagConstraints.WEST, + GridBagConstraints.BOTH, + new Insets(10, 5, 10, 10), 0, 0)); + panel1.add(okButton, + new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.EAST, + GridBagConstraints.NONE, + new Insets(0, 0, 10, 5), 0, 0)); + panel1.add(cancelButton, + new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, + GridBagConstraints.WEST, + GridBagConstraints.NONE, + new Insets(0, 10, 10, 10), 0, 0)); } - } - - public GoToPageDialog() { - this(null, "", false); - } - - void jbInit() throws Exception { - panel1.setLayout(gridBagLayout1); - pgNbLabel.setText("Page number"); - okButton.setText("Ok"); - okButton.addActionListener(new java.awt.event.ActionListener() { - - public void actionPerformed(ActionEvent e) { - okButton_actionPerformed(e); - } - }); - cancelButton.setText("Cancel"); - cancelButton.addActionListener(new java.awt.event.ActionListener() { - - public void actionPerformed(ActionEvent e) { - cancelButton_actionPerformed(e); - } - }); - panel1.setMinimumSize(new Dimension(250, 78)); - getContentPane().add(panel1); - panel1.add(pgNbLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 10, 10, 5), 0, 0)); - panel1.add(pgNbField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10, 5, 10, 10), 0, 0)); - panel1.add(okButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 10, 5), 0, 0)); - panel1.add(cancelButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 - ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 10, 10), 0, 0)); - } - - void okButton_actionPerformed(ActionEvent e) { - try { - pageNumber = Integer.parseInt(pgNbField.getText()); - dispose(); - } catch (Exception ex) { - pgNbField.setText("???"); + + void okButton_actionPerformed(ActionEvent e) { + try { + pageNumber = Integer.parseInt(pgNbField.getText()); + dispose(); + } catch (Exception ex) { + pgNbField.setText("???"); + } + } - } + void cancelButton_actionPerformed(ActionEvent e) { + pageNumber = -1; + dispose(); + } - void cancelButton_actionPerformed(ActionEvent e) { - pageNumber = -1; - dispose(); - } + public int getPageNumber() { + return pageNumber; + } - public int getPageNumber() { - return pageNumber; - } -}
\ No newline at end of file +} |