From f33f5714492bf951c227cbd278dc2fe28ea59b83 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Wed, 6 Nov 2002 14:30:16 +0000 Subject: [PATCH] awt viewer improvements uses java PropertyResourceBundle for locale strings cleaned up code and removed old classes other small improvements Submitted by: Oleg Tkachenko git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195433 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/apps/AWTStarter.java | 148 ++--- .../apache/fop/render/awt/AWTRenderer.java | 2 +- src/org/apache/fop/viewer/Command.java | 64 +- src/org/apache/fop/viewer/GoToPageDialog.java | 80 ++- src/org/apache/fop/viewer/IconToolBar.java | 43 -- src/org/apache/fop/viewer/Images/fop.gif | Bin 0 -> 2452 bytes src/org/apache/fop/viewer/Images/reload.gif | Bin 0 -> 889 bytes .../apache/fop/viewer/LoadableProperties.java | 86 --- .../apache/fop/viewer/MessageException.java | 78 --- src/org/apache/fop/viewer/MessagesDialog.java | 265 --------- src/org/apache/fop/viewer/PreviewDialog.java | 557 +++++++----------- .../fop/viewer/PreviewDialogAboutBox.java | 106 ++-- .../apache/fop/viewer/ProgressListener.java | 23 - .../fop/viewer/SecureResourceBundle.java | 100 ---- src/org/apache/fop/viewer/Translator.java | 48 +- src/org/apache/fop/viewer/UserMessage.java | 429 -------------- .../fop/viewer/resources/Viewer.properties | 43 ++ .../fop/viewer/resources/Viewer_cs.properties | 34 ++ .../fop/viewer/resources/Viewer_de.properties | 32 + .../fop/viewer/resources/Viewer_fi.properties | 23 + .../fop/viewer/resources/Viewer_fr.properties | 21 + .../fop/viewer/resources/Viewer_it.properties | 21 + .../fop/viewer/resources/Viewer_ja.properties | 28 + .../fop/viewer/resources/Viewer_pl.properties | 24 + .../fop/viewer/resources/Viewer_ru.properties | 43 ++ .../apache/fop/viewer/resources/messages.de | 78 --- .../apache/fop/viewer/resources/messages.en | 80 --- .../apache/fop/viewer/resources/resources.de | 45 -- .../apache/fop/viewer/resources/resources.en | 4 - .../apache/fop/viewer/resources/resources.fi | 16 - .../apache/fop/viewer/resources/resources.fr | 13 - .../apache/fop/viewer/resources/resources.it | 14 - .../apache/fop/viewer/resources/resources.pl | 17 - .../apache/fop/viewer/resources/resources.ru | 38 -- 34 files changed, 670 insertions(+), 1933 deletions(-) delete mode 100644 src/org/apache/fop/viewer/IconToolBar.java create mode 100644 src/org/apache/fop/viewer/Images/fop.gif create mode 100644 src/org/apache/fop/viewer/Images/reload.gif delete mode 100644 src/org/apache/fop/viewer/LoadableProperties.java delete mode 100644 src/org/apache/fop/viewer/MessageException.java delete mode 100644 src/org/apache/fop/viewer/MessagesDialog.java delete mode 100644 src/org/apache/fop/viewer/ProgressListener.java delete mode 100644 src/org/apache/fop/viewer/SecureResourceBundle.java delete mode 100644 src/org/apache/fop/viewer/UserMessage.java create mode 100644 src/org/apache/fop/viewer/resources/Viewer.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_cs.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_de.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_fi.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_fr.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_it.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_ja.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_pl.properties create mode 100644 src/org/apache/fop/viewer/resources/Viewer_ru.properties delete mode 100644 src/org/apache/fop/viewer/resources/messages.de delete mode 100644 src/org/apache/fop/viewer/resources/messages.en delete mode 100644 src/org/apache/fop/viewer/resources/resources.de delete mode 100644 src/org/apache/fop/viewer/resources/resources.en delete mode 100644 src/org/apache/fop/viewer/resources/resources.fi delete mode 100644 src/org/apache/fop/viewer/resources/resources.fr delete mode 100644 src/org/apache/fop/viewer/resources/resources.it delete mode 100644 src/org/apache/fop/viewer/resources/resources.pl delete mode 100644 src/org/apache/fop/viewer/resources/resources.ru diff --git a/src/org/apache/fop/apps/AWTStarter.java b/src/org/apache/fop/apps/AWTStarter.java index 682167629..961822e26 100644 --- a/src/org/apache/fop/apps/AWTStarter.java +++ b/src/org/apache/fop/apps/AWTStarter.java @@ -6,136 +6,84 @@ */ package org.apache.fop.apps; -/* - * originally contributed by - * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com - * Modified to use streaming API by Mark Lillywhite, mark-fop@inomial.com - */ -import org.apache.fop.viewer.*; -import org.apache.fop.render.awt.*; +//FOP +import org.apache.fop.render.awt.AWTRenderer; +import org.apache.fop.viewer.PreviewDialog; +import org.apache.fop.viewer.Translator; +//Java import javax.swing.UIManager; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.util.Locale; // SAX import org.xml.sax.XMLReader; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - - - -// Java -import java.io.FileReader; -import java.io.File; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.io.IOException; -import java.io.FileNotFoundException; -import java.io.FileInputStream; -import java.io.InputStream; -import java.net.URL; -import java.util.*; - /** - * initialize AWT previewer + * AWT Viewer starter. + * Originally contributed by: + * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com + * Modified to use streaming API by Mark Lillywhite, mark-fop@inomial.com */ public class AWTStarter extends CommandLineStarter { + private PreviewDialog frame; + private Translator translator; + private Driver driver; + private XMLReader parser; - PreviewDialog frame; - AWTRenderer renderer; - public static String TRANSLATION_PATH = - "/org/apache/fop/viewer/resources/"; - - private Translator resource; - - public AWTStarter(CommandLineOptions commandLineOptions) - throws FOPException { + public AWTStarter(CommandLineOptions commandLineOptions) throws FOPException { super(commandLineOptions); init(); } - private void init() { - try { - UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()); - } catch (Exception e) { - e.printStackTrace(); - } - + private void init() throws FOPException { + //Creates Translator according to the language String language = commandLineOptions.getLanguage(); - - if (language == null) { - try { - language = System.getProperty("user.language"); - } catch(SecurityException se) { - // if this is running in a secure place - } - } - resource = getResourceBundle(TRANSLATION_PATH + "resources." - + language); - - UserMessage.setTranslator(getResourceBundle(TRANSLATION_PATH - + "messages." - + language)); - - resource.setMissingEmphasized(false); - renderer = new AWTRenderer(resource); - frame = createPreviewDialog(renderer, resource); - //renderer.setProgressListener(frame); + if (language == null) + translator = new Translator(Locale.getDefault()); + else + translator = new Translator(new Locale(language, "")); + AWTRenderer renderer = new AWTRenderer(translator); + frame = createPreviewDialog(renderer, translator); renderer.setComponent(frame); - } - - - public void run() throws FOPException { - Driver driver = new Driver(); - setupLogger(driver); - - // init parser - frame.progress(resource.getString("Init parser") + " ..."); - XMLReader parser = inputHandler.getParser(); - + driver = new Driver(); + driver.setRenderer(renderer); + parser = inputHandler.getParser(); if (parser == null) { throw new FOPException("Unable to create SAX parser"); } + } - setParserFeatures(parser); - + /** + * Runs formatting. + */ + public void run() throws FOPException { + driver.reset(); try { - driver.setRenderer(renderer); - - // build FO tree: time - frame.progress(resource.getString("Build FO tree") + " ..."); + frame.setStatus(translator.getString("Status.Build.FO.tree")); driver.render(parser, inputHandler.getInputSource()); - - frame.progress(resource.getString("Show")); + frame.setStatus(translator.getString("Status.Show")); frame.showPage(); - } catch (Exception e) { - if (e instanceof FOPException) { - throw (FOPException)e; - } - throw new FOPException(e); + frame.reportException(e); } - } - protected PreviewDialog createPreviewDialog(AWTRenderer renderer, + private PreviewDialog createPreviewDialog(AWTRenderer renderer, Translator res) { - PreviewDialog frame = new PreviewDialog(renderer, res); - frame.validate(); + PreviewDialog frame = new PreviewDialog(this, renderer, res); frame.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent we) { System.exit(0); } }); - // center window + //Centers the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); if (frameSize.height > screenSize.height) { @@ -149,21 +97,5 @@ public class AWTStarter extends CommandLineStarter { frame.setVisible(true); return frame; } - - - - private SecureResourceBundle getResourceBundle(String path) { - InputStream in = null; - - try { - URL url = getClass().getResource(path); - in = url.openStream(); - } catch (Exception ex) { - getLogger().error("Can't find URL to: <" + path + "> " - + ex.getMessage(), ex); - } - return new SecureResourceBundle(in); - } - } diff --git a/src/org/apache/fop/render/awt/AWTRenderer.java b/src/org/apache/fop/render/awt/AWTRenderer.java index b7ec5c5e5..6cb0fa1cc 100644 --- a/src/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/org/apache/fop/render/awt/AWTRenderer.java @@ -60,7 +60,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable protected double scaleFactor = 100.0; protected int pageNumber = 0; protected Vector pageList = new Vector(); - protected ProgressListener progressListener = null; + //protected ProgressListener progressListener = null; protected Translator res = null; protected Hashtable fontNames = new Hashtable(); diff --git a/src/org/apache/fop/viewer/Command.java b/src/org/apache/fop/viewer/Command.java index 452d92c03..d2404afb4 100644 --- a/src/org/apache/fop/viewer/Command.java +++ b/src/org/apache/fop/viewer/Command.java @@ -6,60 +6,60 @@ */ package org.apache.fop.viewer; -/* - * Juergen Verwohlt: Juergen.Verwohlt@jcatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jcatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jcatalog.com - */ +//Java import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.ImageIcon; -import java.net.*; - +import java.net.URL; /** - * Klasse für UI-Kommandos. Die Kommandos können in das Menüsystem oder - * in eine Toolbar eingefügt werden.
- * Commands unterstützen mehrsprachigkeit.
- * Durch überschreiben der Methode doit kann die Klasse customisiert werden. - * Über die Methode undoit kann Undo-Funktionalität unterstützt werden.
- * - * @author Juergen.Verwohlt@jcatalog.com - * @version 1.0 18.03.99 + * This class represents UI-commands, which can be used as menu or toolbar + * items
. + * When the Command object receives action event, that object's + * doit method is invoked. doit method by default + * does nothing and the class customer have to override it to implement + * any action handling logic. + * Originally contributed by: + * Juergen Verwohlt: Juergen.Verwohlt@jcatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jcatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jcatalog.com */ public class Command extends AbstractAction { - public static String IMAGE_DIR = "/org/apache/fop/viewer/Images/"; + private static String IMAGE_DIR = "Images/"; + /** + * Creates Command object with a given name and + * sets the name as a tooltip text. No associated icon image. + */ public Command(String name) { - this(name, (ImageIcon)null); - } - - public Command(String name, ImageIcon anIcon) { - super(name, anIcon); + super(name); + putValue(SHORT_DESCRIPTION, name); } + /** + * Creates Command object with a given name, the same + * tooltip text and icon image if appropriate image file is found. + */ public Command(String name, String iconName) { super(name); - String path = IMAGE_DIR + iconName + ".gif"; - URL url = getClass().getResource(path); - if (url == null) { - //log.error("Icon not found: " + path); - } else + putValue(SHORT_DESCRIPTION, name); + URL url = getClass().getResource(IMAGE_DIR + iconName + ".gif"); + if (url != null) { putValue(SMALL_ICON, new ImageIcon(url)); + } } public void actionPerformed(ActionEvent e) { doit(); } + /** + * Action handler, have to be overrided by subclasses. + */ public void doit() { - //log.error("Not implemented."); + //Do nothing } - - public void undoit() { - //log.error("Not implemented."); - } - } + diff --git a/src/org/apache/fop/viewer/GoToPageDialog.java b/src/org/apache/fop/viewer/GoToPageDialog.java index 0040d75ea..39a8bcd02 100644 --- a/src/org/apache/fop/viewer/GoToPageDialog.java +++ b/src/org/apache/fop/viewer/GoToPageDialog.java @@ -5,62 +5,53 @@ * 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; import java.awt.*; import javax.swing.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +/** + * Go to Page Dialog. + * Originally contributed by: + * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com + */ 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(); - } catch (Exception ex) { - //log.error("GoToPageDialog: Konstruktor: " - // + ex.getMessage(), ex); - } + private JTextField pgNbField; + private int pageNumber = -1; + + /** + * Creates modal dialog with a given title, attached to a given frame. + */ + public GoToPageDialog(Frame frame, String title, Translator translator) { + super(frame, title, true); + jbInit(translator); + pack(); } - public GoToPageDialog() { - this(null, "", false); - } - - void jbInit() throws Exception { + private void jbInit(Translator translator) { + JPanel panel1 = new JPanel(); + GridBagLayout gridBagLayout1 = new GridBagLayout(); + JLabel pgNbLabel = new JLabel(); + pgNbField = new JTextField(); + JButton okButton = new JButton(); + JButton cancelButton = new JButton(); panel1.setLayout(gridBagLayout1); - pgNbLabel.setText("Page number"); - okButton.setText("Ok"); - okButton.addActionListener(new java.awt.event.ActionListener() { - + pgNbLabel.setText(translator.getString("Label.Page.number")); + okButton.setText(translator.getString("Button.Ok")); + okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButton_actionPerformed(e); } - }); - cancelButton.setText("Cancel"); + cancelButton.setText(translator.getString("Button.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); @@ -86,23 +77,26 @@ public class GoToPageDialog extends JDialog { new Insets(0, 10, 10, 10), 0, 0)); } - void okButton_actionPerformed(ActionEvent e) { + private void okButton_actionPerformed(ActionEvent e) { try { pageNumber = Integer.parseInt(pgNbField.getText()); dispose(); - } catch (Exception ex) { + } catch (NumberFormatException nfe) { pgNbField.setText("???"); } } - void cancelButton_actionPerformed(ActionEvent e) { + private void cancelButton_actionPerformed(ActionEvent e) { pageNumber = -1; dispose(); } + /** + * Returns page number, entered by user. + */ public int getPageNumber() { return pageNumber; } - } + diff --git a/src/org/apache/fop/viewer/IconToolBar.java b/src/org/apache/fop/viewer/IconToolBar.java deleted file mode 100644 index c67d13eb4..000000000 --- a/src/org/apache/fop/viewer/IconToolBar.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -/* - * originally contributed by - * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com - */ - - -import javax.swing.*; -import java.beans.PropertyChangeListener; - -public class IconToolBar extends JToolBar { - - public JButton add(Action a) { - String name = (String)a.getValue(Action.NAME); - Icon icon = (Icon)a.getValue(Action.SMALL_ICON); - return add(a, name, icon); - } - - public JButton add(Action a, String name, Icon icon) { - JButton b = new JButton(icon); - b.setToolTipText(name); - b.setEnabled(a.isEnabled()); - b.addActionListener(a); - add(b); - PropertyChangeListener actionPropertyChangeListener = - createActionChangeListener(b); - a.addPropertyChangeListener(actionPropertyChangeListener); - return b; - } - -} - - diff --git a/src/org/apache/fop/viewer/Images/fop.gif b/src/org/apache/fop/viewer/Images/fop.gif new file mode 100644 index 0000000000000000000000000000000000000000..63aaaae173eb7e3921308d9bb8aa1f69e7db33cb GIT binary patch literal 2452 zcmV;F32XL8Nk%w1VOjtl0QUd@TU%Qg7#GLv$I!mL%=pf=!nBi=m6)-nv9YmCOiZ-F z%*fpDyvfzk^47-2#^nO<{{H^z>gh5vGO4`F(9qDbqn!5k_PgfJ zRa8_&LqnE`h|bQ=wy>o9{QUX(`HPX4Vp?0()z!_bu61>Fq^6@vR7ubB&~k}!a9m!S zo14|TyKHW4-rnBhzq97T!O5+xz@(hgzOQ0yanQN7z{tO=o9kh@ghc-tfZI<8OX&Q%gz0 zte0otTHVv zOHfoPA|ft2F3`!#XklXN>F24hz2LpPTV!piv!+^9RzEH+M2JLpU%sdUJIn zDk8kKwY0Xk*2J*=|No@HqR7a|r@Excw7oVtKTAtUVq#-RNl6NPes=H}*5Pfs{FI43A5MLIeyGcZ9xKrSvXKSDzh5fRPH%*V&a zR$pF=iioVitxG^a@bK@dwX2twmV1wtRa00_S6^6HS2Q;|QfE_eaC1L4IJ>&L3knO> z)Y1L@{jb)pqraZd%gWEq%f#2~$l2&^d4%WZ=jZC?*|WLFqo&HPqsFqM!^q3i)6>+^ z(vW|9&Bw>h#>g%wC@L%{n!>5(#mMc)$AyK4g^rGihlP}%sEme*;J?ALs;0oGrjMhT z(e==HczL6&pQxy(sHmj-|Nf?tj{W`m)4;%^#joz}?WoJDX=!O;WMyPzWM*Y!ox7)N zXJ@Ow!~g&PA^8LV00000EC2ui09pVZ000R80RIUbNU)&6ffOhdRHiVK!-oe6QV0>z zU_yZxD{4HbaAQOYF&y05L~;|iX3m`1TB-6-H*Lx?A@oSIrbJ$wZhgpBqC_?fwr-ti za?FX7V@+U)_*Wto9XD>C0{VkyABn4!JOJu+jDpO631JXza>l`#p~s3|a&ilX51Sel z-kK$A!m9uQNWHSKYLx{GvtHH8G45>%OKa%RDZ;{-x5wUQ4T3<#o1-#sG5+hZmk6>P z$ZC-y^6C`?%0yb>V5JN$M`<_=ya?4nFoaREI&_fbDuFO$Jb3+MgTRt6S$JPf0OJUW zumrk01VHwJ4Z#mB${=Yqib#M}!d?{r+tTV&f&e*$WozwPV!{v~WEH#X>w|p^n=a+z z5TMM`5@!@qNM5^aqmBzwEMmqK@~{940J7vT!7&v`kcd5zNK-~AFVr#%3T&`aK@2ps z^T`Poa@&{D(q&mPDQ2gM>tAHT?GK!ly6tjl{U0`7Vqd5Rjfk7c~AWSPcoM7pt17+$V zr<#GK!BP$cKq!P!qaimkmA7iv(MjL_PKuA8qd2UgWxKqX0+%mPEr6+QYHP z{-f-s1Sz9|Eo@Nq&kGQ&g3LDIFdPy7JntK_Vp3 zieT^fTkpMWURO(S|JY+e0;G^4Pr-QNDUJ!RzFG&w{&-T%DmhrO#|0T9(W^ZMu>k?G z30POJK=;y6kPbP#;BGdr08mRM9*prr8jEzjNHr#yB6c0&`ZLNFq4X?=x*EGnPza#7 z(y|WpjywSXd7aS0-o6Iy71B6$prd1Y-aL z139m=6Z702ng=&=80W2;zuG%s>Q|m;p6_Us{f@gHWg+c>>_HI~_dvWR_ zO@M#_mZE_KAR%o4fX5Ly!3<6e!2sh3!U%#81ai~>96*SLBRr&t1uVdY>_QzE58}mw z_}~LF@D~q4(T^N-;0#e{00A1X18nf)l9*J&29{6>CozHnegtH%1UX1d`12+!gmP1&_0SxG`2-!YUW;>@W=;(n6_3dg8&2&fB^16PkJUH z30g2jEn+eM0vq_#1_&s}D%kZab7IOBczeYeHjPh7s*J3G^7y;3E;p2jS>cn49bvyD8m*I*n(hCu#^xmP$K`B2M&e-j0Ehn2fEmS zJO%IoE`$OCmCyn$g+mZu%mN>^a0LdGp$wZ2G9hf(0zNo!zz!h80>S{m2X1PRc{HJV zviJrmDj|s!q#yyVAVMX`u!3c%APTAg3kpDikLdxx0^j4n31mRlr77eC2{4Z=W-$xC zSb!7=5Sc+vaf*Lr;{_=&L@ZuGgi?KD6)9MOCIkS_0u;0i9gv1{w1ex(fHRs_5THB$w25QPHx S_rLz_ZxjTK08*ARAOJfmQhBQY literal 0 HcmV?d00001 diff --git a/src/org/apache/fop/viewer/Images/reload.gif b/src/org/apache/fop/viewer/Images/reload.gif new file mode 100644 index 0000000000000000000000000000000000000000..405718c1bb03d617c9796f5e833e1aa6893ed9c7 GIT binary patch literal 889 zcmV-<1BU!ZNk%w1VHf}y0QUd@000010RaL60s{jB1Ox;H1qB8M1_uWR2nYxX2?+`c z3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~A^8LW006xJEC2ui02lxm06+*<0DB1>NU)&6g8&jLOgNC?L4ytjE{yoF zqD6=RFkalqvE#*s1u0q-*^A^uk|q&m47t*y%a<@=qHI}lBF&T 0) { - if (str.startsWith("#") || str.startsWith("!")) { - return false; - } - } else { - return false; - } - - int index = str.indexOf("="); - if (index > 0 && str.length() > index) { - return true; - } else { - //log.debug(getClass().getName() - // + ": load(): invalid line " + str + "." - // + " Character '=' missed."); - return false; - } - } - - private String getNextLine(BufferedReader br) { - try { - return br.readLine(); - } catch (Exception e) { - return null; - } - - } - - -} diff --git a/src/org/apache/fop/viewer/MessageException.java b/src/org/apache/fop/viewer/MessageException.java deleted file mode 100644 index eb9b25c15..000000000 --- a/src/org/apache/fop/viewer/MessageException.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -import java.lang.Exception; - -/** - * Die Klasse MessageException ist eine Exception, die - * mit einer Meldung und deren Parametern versehen werden kann. - * Dadurch kann die Meldung über den Exception-Mechanismus an die - * Aufrufer hochgereicht werden, bis schliesslich ein Aufrufer die - * Meldung zur Anzeige bringt. - * - * @author Juergen.Verwohlt@jCatalog.com - * @version 1.0 28.05.99 - * - */ -public class MessageException extends Exception { - - /** - * Angabe der auslösenden Exception, wie z.B. NullPointerException. - * Dieses Feld ist optional. - */ - protected Exception exception; - - /** - * ID der Meldung, die für diese Exception ausgegeben werden soll - */ - protected String messageId; - - /** - * Parameterliste zur Meldung - */ - protected String[] parameterList; - - - // Konstruktoren - - public MessageException() { - this("UNKNOWN_EXCEPTION"); - } - - public MessageException(String aMessageId) { - this(aMessageId, null); - } - - public MessageException(String aMessageId, String[] aParameterList) { - this(aMessageId, aParameterList, null); - } - - public MessageException(String aMessageId, String[] aParameterList, - Exception anException) { - super(aMessageId); - messageId = aMessageId; - parameterList = aParameterList; - exception = anException; - } - - // Zugriffsmethoden - - public String getMessageId() { - return messageId; - } - - public String[] getParameterList() { - return parameterList; - } - - public Exception getException() { - return exception; - } - -} diff --git a/src/org/apache/fop/viewer/MessagesDialog.java b/src/org/apache/fop/viewer/MessagesDialog.java deleted file mode 100644 index dafcefbff..000000000 --- a/src/org/apache/fop/viewer/MessagesDialog.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -import javax.swing.*; - -import java.beans.*; -import java.io.*; -import java.util.*; -import java.awt.*; -import java.awt.event.*; - - -import org.apache.fop.apps.*; - - -/** - * Die Klasse MessagesDialog dient der Anzeige von Meldungen. - * Die Klasse erweitert JOptionPane um die Möglichkeit, auf Knopfdruck - * eine Detailanzeige einzublenden, in der z.B. bei Fehlern der StackTrace ausgegeben - * werden kann. - * - * @author Juergen.Verwohlt@jCatalog.com - * @version 1.0 09.06.99 - */ -public class MessagesDialog extends JOptionPane { - - static Translator res; - - public static void setTranslator(Translator aRes) { - res = aRes; - iniConstants(); - } - - - static String DETAIL_OPTION; - static String YES_OPTION; - static String NO_OPTION; - static String CANCEL_OPTION; - static String OK_OPTION; - - static String[] defaultDetailOption; - static String[] yesNoDetailOption; - static String[] yesNoCancelDetailOption; - static String[] okCancelDetailOption; - - static String[] defaultOption; - static String[] yesNoOption; - static String[] yesNoCancelOption; - static String[] okCancelOption; - - - - private static void iniConstants() { - DETAIL_OPTION = res.getString("Details"); - YES_OPTION = res.getString("Yes"); - NO_OPTION = res.getString("No"); - CANCEL_OPTION = res.getString("Cancel"); - OK_OPTION = res.getString("Ok"); - - defaultDetailOption = new String[] { - OK_OPTION, DETAIL_OPTION - }; - yesNoDetailOption = new String[] { - YES_OPTION, NO_OPTION, DETAIL_OPTION - }; - yesNoCancelDetailOption = new String[] { - YES_OPTION, NO_OPTION, CANCEL_OPTION, DETAIL_OPTION - }; - okCancelDetailOption = new String[] { - OK_OPTION, CANCEL_OPTION, DETAIL_OPTION - }; - - defaultOption = new String[] { - OK_OPTION - }; - yesNoOption = new String[] { - YES_OPTION, NO_OPTION - }; - yesNoCancelOption = new String[] { - YES_OPTION, NO_OPTION, CANCEL_OPTION - }; - okCancelOption = new String[] { - OK_OPTION, CANCEL_OPTION - }; - } - - - protected String detailInformation = null; - protected JDialog dialog = null; - protected boolean showsDetails = false; - - // MessagesDialog.showConfirmDialog(null,preparedMes,title, - // optionTypeIndex,messageTypeIndex); - - public MessagesDialog(Object message, int messageType, int optionType, - Icon icon, Object[] options, Object initialValue) { - super(message, messageType, optionType, icon, options, initialValue); - setMinimumSize(new Dimension(240, 96)); - } - - public static int showConfirmDialog(Component parentComponent, - Object message, String title, - int optionType, int messageType) { - Object[] options; - - switch (optionType) { - case JOptionPane.YES_NO_OPTION: - options = yesNoOption; - break; - case JOptionPane.YES_NO_CANCEL_OPTION: - options = yesNoCancelOption; - break; - case JOptionPane.OK_CANCEL_OPTION: - options = okCancelOption; - break; - default: - options = defaultOption; - } - - MessagesDialog pane = new MessagesDialog(message, messageType, - JOptionPane.DEFAULT_OPTION, - null, options, options[0]); - - pane.setInitialValue(options[0]); - - JDialog dialog = pane.createDialog(parentComponent, title); - - pane.setDialog(dialog); - pane.selectInitialValue(); - - dialog.show(); - - Object selectedValue = pane.getValue(); - - if (selectedValue == null) - return CLOSED_OPTION; - - if (selectedValue.equals(OK_OPTION)) - return JOptionPane.OK_OPTION; - if (selectedValue.equals(CANCEL_OPTION)) - return JOptionPane.CANCEL_OPTION; - if (selectedValue.equals(YES_OPTION)) - return JOptionPane.YES_OPTION; - if (selectedValue.equals(NO_OPTION)) - return JOptionPane.NO_OPTION; - - return CLOSED_OPTION; - } - - /** - * Öffnet ein Dialogfenster, bei dem zusätzlich zu den spez. Buttons noch ein - * 'Detail'-Button erscheint. Wird dieser Knopf vom Benutzer betätigt, erscheint - * die übergebene Detailinformation in einem scrollbaren Bereich des Dialogs. - */ - public static int showDetailDialog(Component parentComponent, - Object message, String title, - int optionType, int messageType, - Icon icon, - String newDetailInformation) { - Object[] options; - - switch (optionType) { - case JOptionPane.YES_NO_OPTION: - options = yesNoDetailOption; - break; - case JOptionPane.YES_NO_CANCEL_OPTION: - options = yesNoCancelDetailOption; - break; - case JOptionPane.OK_CANCEL_OPTION: - options = okCancelDetailOption; - break; - default: - options = defaultDetailOption; - } - - MessagesDialog pane = new MessagesDialog(message, messageType, - JOptionPane.DEFAULT_OPTION, - icon, options, options[0]); - - pane.setDetailInformation(newDetailInformation); - pane.setInitialValue(options[0]); - - JDialog dialog = pane.createDialog(parentComponent, title); - - pane.setDialog(dialog); - pane.selectInitialValue(); - - dialog.show(); - - Object selectedValue = pane.getValue(); - - if (selectedValue == null) - return CLOSED_OPTION; - - if (((String)selectedValue).equals(DETAIL_OPTION)) - return CLOSED_OPTION; - - if (selectedValue.equals(OK_OPTION)) - return JOptionPane.OK_OPTION; - if (selectedValue.equals(CANCEL_OPTION)) - return JOptionPane.CANCEL_OPTION; - if (selectedValue.equals(YES_OPTION)) - return JOptionPane.YES_OPTION; - if (selectedValue.equals(NO_OPTION)) - return JOptionPane.NO_OPTION; - - return CLOSED_OPTION; - } - - /** - * Die Methode fügt in den übergebenen Dialog eine scrollbare Textkomponente ein, - * in der die Detailinformation angezeigt wird. - * - * @param JDialog dialog Der Dialog, in den die Textkomponente eingefügt werden soll - */ - protected void displayDetails(JDialog dialog) { - if (getDetailInformation() != null && dialog != null - && showsDetails == false) { - showsDetails = true; - JScrollPane aScrollPane = new JScrollPane(); - JTextArea aTextArea = new JTextArea(); - StringWriter aStringWriter = new StringWriter(); - - aTextArea.setText(getDetailInformation()); - aTextArea.setEditable(false); - - aScrollPane.getViewport().add(aTextArea, null); - dialog.getContentPane().add(aScrollPane, BorderLayout.SOUTH); - aScrollPane.setPreferredSize(new Dimension(320, 240)); - dialog.pack(); - } - } - - // Zugriff - - public void setValue(Object aValue) { - if (aValue != null && DETAIL_OPTION.equals(aValue)) - displayDetails(getDialog()); - else - super.setValue(aValue); - } - - public String getDetailInformation() { - return detailInformation; - } - - public void setDetailInformation(String aValue) { - detailInformation = aValue; - } - - public JDialog getDialog() { - return dialog; - } - - public void setDialog(JDialog aValue) { - dialog = aValue; - } - -} diff --git a/src/org/apache/fop/viewer/PreviewDialog.java b/src/org/apache/fop/viewer/PreviewDialog.java index 401124b6e..db813dd5d 100644 --- a/src/org/apache/fop/viewer/PreviewDialog.java +++ b/src/org/apache/fop/viewer/PreviewDialog.java @@ -4,346 +4,298 @@ * For details on use and redistribution please refer to the * LICENSE file included with these sources. */ - + package org.apache.fop.viewer; - -/* - * originally contributed by - * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com - * Doro Wiarda (wiarda@dwiarda.com: - * added MessageListener support and made - * the showing of the progress and error - * messages Swing thread safe. - * This is needed as xml parse errors do not - * necessarily occur in the - * EventDispatchThread. - */ - + +//Java import java.awt.*; -import java.awt.print.*; -import java.awt.event.*; -import java.awt.image.BufferedImage; -import java.util.StringTokenizer; -import java.util.ArrayList; - import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.print.PrinterJob; +import java.awt.print.PrinterException; +import java.awt.image.BufferedImage; -import org.apache.fop.layout.*; -import org.apache.fop.render.awt.*; +//FOP +import org.apache.fop.apps.AWTStarter; +import org.apache.fop.apps.FOPException; +import org.apache.fop.render.awt.AWTRenderer; /** - * Frame and User Interface for Preview + * AWT Viewer main window. + * Originally contributed by: + * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com */ -public class PreviewDialog extends JFrame implements ProgressListener { - - protected Translator res; - - protected int currentPage = 0; - protected int pageCount = 0; - +public class PreviewDialog extends JFrame { + protected Translator translator; protected AWTRenderer renderer; + protected AWTStarter starter; - protected IconToolBar toolBar = new IconToolBar(); - - protected Command printAction; - protected Command firstPageAction; - protected Command previousPageAction; - protected Command nextPageAction; - protected Command lastPageAction; - - protected JLabel zoomLabel = - new JLabel(); // {public float getAlignmentY() { return 0.0f; }}; - protected JComboBox scale = new JComboBox() { - public float getAlignmentY() { - return 0.5f; - } - - }; - - protected JScrollPane previewArea = new JScrollPane(); - // protected JLabel statusBar = new JLabel(); - protected JPanel statusBar = new JPanel(); - protected GridBagLayout statusBarLayout = new GridBagLayout(); + private int currentPage = 0; + private int pageCount = 0; + private Reloader reloader; + private JComboBox scale; + private JLabel processStatus; + private JLabel pageLabel; + private JLabel infoStatus; - protected JLabel statisticsStatus = new JLabel(); - protected JLabel processStatus = new JLabel(); - protected JLabel infoStatus = new JLabel(); - protected JLabel previewImageLabel = new JLabel(); + /** + * Creates a new PreviewDialog that uses the given starter, renderer and translator. + * @param aStarter the to use starter + * @param aRenderer the to use renderer + * @param aRes the to use translator + */ + public PreviewDialog(AWTStarter aStarter, AWTRenderer aRenderer, Translator aRes) { + this(aRenderer, aRes); + starter = aStarter; + } /** - * Create a new PreviewDialog that uses the given renderer and translator. - * + * Creates a new PreviewDialog that uses the given renderer and translator. * @param aRenderer the to use renderer * @param aRes the to use translator */ public PreviewDialog(AWTRenderer aRenderer, Translator aRes) { - res = aRes; + translator = aRes; renderer = aRenderer; - printAction = new Command(res.getString("Print"), "Print") { + //Commands aka Actions + Command printAction = new Command(translator.getString("Menu.Print"), "Print") { public void doit() { print(); } - }; - firstPageAction = new Command(res.getString("First page"), + Command firstPageAction = new Command(translator.getString("Menu.First.page"), "firstpg") { public void doit() { - goToFirstPage(null); + goToFirstPage(); } - }; - previousPageAction = new Command(res.getString("Previous page"), + Command previousPageAction = new Command(translator.getString("Menu.Prev.page"), "prevpg") { public void doit() { - goToPreviousPage(null); + goToPreviousPage(); } - }; - nextPageAction = new Command(res.getString("Next page"), "nextpg") { + Command nextPageAction = new Command(translator.getString("Menu.Next.page"), "nextpg") { public void doit() { - goToNextPage(null); + goToNextPage(); } }; - lastPageAction = new Command(res.getString("Last page"), "lastpg") { + Command lastPageAction = new Command(translator.getString("Menu.Last.page"), "lastpg") { public void doit() { - goToLastPage(null); + goToLastPage(); + } + }; + Command reloadAction = new Command(translator.getString("Menu.Reload"), "reload") { + public void doit() { + reload(); } - }; + setTitle("FOP: AWT-" + translator.getString("Title.Preview")); setDefaultCloseOperation(DISPOSE_ON_CLOSE); - this.setSize(new Dimension(379, 476)); - previewArea.setMinimumSize(new Dimension(50, 50)); - - this.setTitle("FOP: AWT-" + res.getString("Preview")); - scale.addItem("25"); - scale.addItem("50"); - scale.addItem("75"); - scale.addItem("100"); - scale.addItem("150"); - scale.addItem("200"); + //Sets size to be 61%x90% of the screen size + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + //Rather frivolous size - fits A4 page width in 1024x768 screen on my desktop + setSize(screen.width*61/100, screen.height*9/10); + //Page view stuff + pageLabel = new JLabel(); + JScrollPane previewArea = new JScrollPane(pageLabel); + previewArea.getViewport().setBackground(Color.gray); + previewArea.setMinimumSize(new Dimension(50, 50)); + getContentPane().add(previewArea, BorderLayout.CENTER); + + //Scaling combobox + scale = new JComboBox(); + scale.addItem("25%"); + scale.addItem("50%"); + scale.addItem("75%"); + scale.addItem("100%"); + scale.addItem("150%"); + scale.addItem("200%"); scale.setMaximumSize(new Dimension(80, 24)); scale.setPreferredSize(new Dimension(80, 24)); - - scale.addActionListener(new java.awt.event.ActionListener() { + scale.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scale_actionPerformed(e); } - }); - - scale.setSelectedItem("100"); + scale.setSelectedItem("100%"); renderer.setScaleFactor(100.0); - zoomLabel.setText(res.getString("Zoom")); - - this.setJMenuBar(setupMenue()); - - this.getContentPane().add(toolBar, BorderLayout.NORTH); + //Menu + setJMenuBar(setupMenu()); + //Toolbar + JToolBar toolBar = new JToolBar(); toolBar.add(printAction); + toolBar.add(reloadAction); toolBar.addSeparator(); toolBar.add(firstPageAction); toolBar.add(previousPageAction); toolBar.add(nextPageAction); toolBar.add(lastPageAction); toolBar.addSeparator(); - toolBar.add(zoomLabel, null); + toolBar.add(new JLabel(translator.getString("Menu.Zoom"))); toolBar.addSeparator(); - toolBar.add(scale, null); - - this.getContentPane().add(previewArea, BorderLayout.CENTER); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - - statisticsStatus.setBorder(BorderFactory.createEtchedBorder()); - processStatus.setBorder(BorderFactory.createEtchedBorder()); - infoStatus.setBorder(BorderFactory.createEtchedBorder()); - - statusBar.setLayout(statusBarLayout); + toolBar.add(scale); + getContentPane().add(toolBar, BorderLayout.NORTH); + //Status bar + JPanel statusBar = new JPanel(); + processStatus = new JLabel(); + processStatus.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(0,3,0,0))); + infoStatus = new JLabel(); + infoStatus.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(0,3,0,0))); + + statusBar.setLayout(new GridBagLayout()); processStatus.setPreferredSize(new Dimension(200, 21)); - statisticsStatus.setPreferredSize(new Dimension(100, 21)); - infoStatus.setPreferredSize(new Dimension(100, 21)); processStatus.setMinimumSize(new Dimension(200, 21)); - statisticsStatus.setMinimumSize(new Dimension(100, 21)); + + infoStatus.setPreferredSize(new Dimension(100, 21)); infoStatus.setMinimumSize(new Dimension(100, 21)); statusBar.add(processStatus, - new GridBagConstraints(0, 0, 2, 1, 2.0, 0.0, - GridBagConstraints.CENTER, - GridBagConstraints.HORIZONTAL, - new Insets(0, 0, 0, 5), 0, 0)); - statusBar.add(statisticsStatus, - new GridBagConstraints(2, 0, 1, 2, 1.0, 0.0, + new GridBagConstraints(0, 0, 1, 0, 2.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, - new Insets(0, 0, 0, 5), 0, 0)); + new Insets(0, 0, 0, 3), 0, 0)); statusBar.add(infoStatus, - new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, + new GridBagConstraints(1, 0, 1, 0, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); - - previewArea.getViewport().add(previewImageLabel); - showPage(); + getContentPane().add(statusBar, BorderLayout.SOUTH); } /** - * Create a new menubar to be shown in this window. - * + * Creates a new menubar to be shown in this window. * @return the newly created menubar */ - private JMenuBar setupMenue() { - JMenuBar menuBar; - JMenuItem menuItem; - JMenu menu; - JMenu subMenu; - - menuBar = new JMenuBar(); - menu = new JMenu(res.getString("File")); - subMenu = new JMenu("OutputFormat"); - subMenu.add(new Command("mHTML")); - subMenu.add(new Command("mPDF")); - subMenu.add(new Command("mRTF")); - subMenu.add(new Command("mTEXT")); - // menu.add(subMenu); - // menu.addSeparator(); - menu.add(new Command(res.getString("Print")) { + private JMenuBar setupMenu() { + JMenuBar menuBar = new JMenuBar(); + JMenu menu = new JMenu(translator.getString("Menu.File")); + + //Adds mostly the same actions, but without icons + menu.add(new Command(translator.getString("Menu.Print")) { public void doit() { print(); } - + }); + menu.add(new Command(translator.getString("Menu.Reload")) { + public void doit() { + reload(); + } }); menu.addSeparator(); - menu.add(new Command(res.getString("Exit")) { + menu.add(new Command(translator.getString("Menu.Exit")) { public void doit() { dispose(); } - }); menuBar.add(menu); - menu = new JMenu(res.getString("View")); - menu.add(new Command(res.getString("First page")) { + menu = new JMenu(translator.getString("Menu.View")); + menu.add(new Command(translator.getString("Menu.First.page")) { public void doit() { - goToFirstPage(null); + goToFirstPage(); } - }); - menu.add(new Command(res.getString("Previous page")) { + menu.add(new Command(translator.getString("Menu.Prev.page")) { public void doit() { - goToPreviousPage(null); + goToPreviousPage(); } - }); - menu.add(new Command(res.getString("Next page")) { + menu.add(new Command(translator.getString("Menu.Next.page")) { public void doit() { - goToNextPage(null); + goToNextPage(); } - }); - menu.add(new Command(res.getString("Last page")) { + menu.add(new Command(translator.getString("Menu.Last.page")) { public void doit() { - goToLastPage(null); + goToLastPage(); } - }); - menu.add(new Command(res.getString("Go to Page") + " ...") { + menu.add(new Command(translator.getString("Menu.Go.to.Page") + " ...") { public void doit() { - goToPage(null); + showGoToPageDialog(); } - }); menu.addSeparator(); - subMenu = new JMenu(res.getString("Zoom")); + JMenu subMenu = new JMenu(translator.getString("Menu.Zoom")); subMenu.add(new Command("25%") { public void doit() { setScale(25.0); } - }); subMenu.add(new Command("50%") { public void doit() { setScale(50.0); } - }); subMenu.add(new Command("75%") { public void doit() { setScale(75.0); } - }); subMenu.add(new Command("100%") { public void doit() { setScale(100.0); } - }); subMenu.add(new Command("150%") { public void doit() { setScale(150.0); } - }); subMenu.add(new Command("200%") { public void doit() { setScale(200.0); } - }); menu.add(subMenu); menu.addSeparator(); - menu.add(new Command(res.getString("Default zoom")) { + menu.add(new Command(translator.getString("Menu.Default.zoom")) { public void doit() { setScale(100.0); } - }); menuBar.add(menu); - menu = new JMenu(res.getString("Help")); - menu.add(new Command(res.getString("Index"))); - menu.addSeparator(); - menu.add(new Command(res.getString("Introduction"))); - menu.addSeparator(); - menu.add(new Command(res.getString("About")) { + menu = new JMenu(translator.getString("Menu.Help")); + menu.add(new Command(translator.getString("Menu.About")) { public void doit() { - startHelpAbout(null); + startHelpAbout(); } - }); menuBar.add(menu); return menuBar; } - // Aktion Hilfe | Info durchgeführt - /** - * Show the About box - * - * @param e a value of type 'ActionEvent' + * Shows the About box */ - public void startHelpAbout(ActionEvent e) { - PreviewDialogAboutBox dlg = new PreviewDialogAboutBox(this); + private void startHelpAbout() { + PreviewDialogAboutBox dlg = new PreviewDialogAboutBox(this, translator); + //Centers the box Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); - dlg.setModal(true); - dlg.show(); + dlg.setVisible(true); } /** - * Change the current visible page - * + * Changes the current visible page * @param number the page number to go to */ - private void goToPage(int number) { + private void goToPage(int number) { currentPage = number; renderer.setPageNumber(number); showPage(); @@ -352,7 +304,7 @@ public class PreviewDialog extends JFrame implements ProgressListener { /** * Shows the previous page. */ - private void goToPreviousPage(ActionEvent e) { + private void goToPreviousPage() { if (currentPage <= 0) return; currentPage--; @@ -363,7 +315,7 @@ public class PreviewDialog extends JFrame implements ProgressListener { /** * Shows the next page. */ - private void goToNextPage(ActionEvent e) { + private void goToNextPage() { if (currentPage >= pageCount - 1) return; currentPage++; @@ -373,52 +325,75 @@ public class PreviewDialog extends JFrame implements ProgressListener { /** * Shows the last page. */ - private void goToLastPage(ActionEvent e) { - + private void goToLastPage() { if (currentPage == pageCount - 1) return; currentPage = pageCount - 1; - goToPage(currentPage); } /** - * Shows a page by number. + * Reloads and reformats document. + */ + private synchronized void reload() { + if (reloader == null || !reloader.isAlive()) { + reloader = new Reloader(); + reloader.start(); + } + } + + /** + * This class is used to reload document in + * a thread safe way. */ - private void goToPage(ActionEvent e) { + private class Reloader extends Thread { + public void run() { + pageLabel.setIcon(null); + infoStatus.setText(""); + currentPage = 0; + //Cleans up renderer - to be done + //while (renderer.getPageCount() != 0) + // renderer.removePage(0); + try { + starter.run(); + } catch (FOPException e) { + reportException(e); + } + } + } + /** + * Shows "go to page" dialog and then goes to the selected page + */ + private void showGoToPageDialog() { GoToPageDialog d = new GoToPageDialog(this, - res.getString("Go to Page"), - true); + translator.getString("Menu.Go.to.Page"), translator); d.setLocation((int)getLocation().getX() + 50, (int)getLocation().getY() + 50); - d.show(); + d.setVisible(true); currentPage = d.getPageNumber(); - if (currentPage < 1 || currentPage > pageCount) return; - currentPage--; - goToPage(currentPage); } /** * Shows the first page. */ - private void goToFirstPage(ActionEvent e) { + private void goToFirstPage() { if (currentPage == 0) return; currentPage = 0; goToPage(currentPage); } + /** + * Prints the document + */ private void print() { PrinterJob pj = PrinterJob.getPrinterJob(); - // Nicht nötig, Pageable get a Printable. - // pj.setPrintable(renderer); pj.setPageable(renderer); - if (pj.printDialog()) { try { pj.print(); @@ -428,8 +403,10 @@ public class PreviewDialog extends JFrame implements ProgressListener { } } - public void setScale(double scaleFactor) { - + /** + * Scales page image + */ + private void setScale(double scaleFactor) { if (scaleFactor == 25.0) scale.setSelectedIndex(0); else if (scaleFactor == 50.0) @@ -442,74 +419,47 @@ public class PreviewDialog extends JFrame implements ProgressListener { scale.setSelectedIndex(4); else if (scaleFactor == 200.0) scale.setSelectedIndex(5); - renderer.setScaleFactor(scaleFactor); showPage(); } - void scale_actionPerformed(ActionEvent e) { - setScale(new Double((String)scale.getSelectedItem()).doubleValue()); - } - - public void progress(int percentage) { - progress(new String(percentage + "%")); - } - - public void progress(int percentage, String message) { - progress(new String(message + " " + percentage + "%")); + private void scale_actionPerformed(ActionEvent e) { + String item = (String)scale.getSelectedItem(); + setScale(Double.parseDouble(item.substring(0, item.indexOf('%')))); } - /** - * Setting the text of a JLabel is not thread save, it - * needs to be done in the EventThread. Here we make sure - * it is done. + * Sets message to be shown in the status bar in a thread safe way. */ - public void progress(String message) { - SwingUtilities.invokeLater(new showProgress(message, false)); + public void setStatus(String message) { + SwingUtilities.invokeLater(new ShowStatus(message)); } - /** - * This class is used to show status and error messages in - * a thread safe way. + * This class is used to show status in a thread safe way. */ - class showProgress implements Runnable { - + private class ShowStatus implements Runnable { /** * The message to display */ - Object message; - - /** - * Is this an errorMessage, i.e. should it be shown in - * an JOptionPane or in the status bar. - */ - boolean isErrorMessage = false; - + String message; /** - * Constructs showProgress thread + * Constructs ShowStatus thread * @param message message to display - * @param isErrorMessage show in status bar or in JOptionPane */ - public showProgress(Object message, boolean isErrorMessage) { + public ShowStatus(String message) { this.message = message; - this.isErrorMessage = isErrorMessage; } - public void run() { - if (isErrorMessage) { - JOptionPane.showMessageDialog(null, message, "Error", - JOptionPane.ERROR_MESSAGE); - } else - processStatus.setText(message.toString()); + processStatus.setText(message.toString()); } - } + /** + * Starts rendering process and shows the current page. + */ public void showPage() { - showPageImage viewer = new showPageImage(); - + ShowPageImage viewer = new ShowPageImage(); if (SwingUtilities.isEventDispatchThread()) { viewer.run(); } else @@ -521,108 +471,39 @@ public class PreviewDialog extends JFrame implements ProgressListener { * This class is used to update the page image * in a thread safe way. */ - class showPageImage implements Runnable { - + private class ShowPageImage implements Runnable { /** - * The run method that does the actuall updating + * The run method that does the actual updating */ public void run() { - BufferedImage pageImage = null; - Graphics graphics = null; - - //renderer.render(currentPage); - pageImage = renderer.getLastRenderedPage(); + //Rendering a page - to be done + /* + renderer.render(currentPage); + BufferedImage pageImage = renderer.getLastRenderedPage(); if (pageImage == null) return; - graphics = pageImage.getGraphics(); - graphics.setColor(Color.black); - graphics.drawRect(0, 0, pageImage.getWidth() - 1, - pageImage.getHeight() - 1); - - previewImageLabel.setIcon(new ImageIcon(pageImage)); - + pageLabel.setIcon(new ImageIcon(pageImage)); pageCount = renderer.getPageCount(); - - statisticsStatus.setText(res.getString("Page") + " " - + (currentPage + 1) + " " - + res.getString("of") + " " + pageCount); + //Updates status bar + infoStatus.setText(translator.getString("Status.Page") + " " + + (currentPage + 1) + " " + + translator.getString("Status.of") + " " + pageCount); + */ } - } - /** - * Called by logger if an error message or a - * log message is received. + * Opens standard Swing error dialog box and reports given exception details. */ - public void processMessage() { -/* String error = event.getMessage(); - String text = processStatus.getText(); - FontMetrics fmt = - processStatus.getFontMetrics(processStatus.getFont()); - int width = processStatus.getWidth() - fmt.stringWidth("..."); - showProgress showIt; - - if (event.getMessageType() == event.LOG) { - if (!text.endsWith("\n")) { - text = text + error; - while (fmt.stringWidth(text) > width) { - text = text.substring(1); - width = processStatus.getWidth() - fmt.stringWidth("..."); - } - } else - text = error; - progress(text); - } else { - error = error.trim(); - if (error.equals(">")) { - text = text + error; - while (fmt.stringWidth(text) > width) { - text = text.substring(1); - width = processStatus.getWidth() - fmt.stringWidth("..."); - } - progress(processStatus.getText() + error); - return; - } - if (error.equals("")) - return; - if (error.length() < 60) { - showIt = new showProgress(error, true); - } else { - StringTokenizer tok = new StringTokenizer(error, " "); - ArrayList labels = new ArrayList(); - StringBuffer buffer = new StringBuffer(); - String tmp, list[]; - - while (tok.hasMoreTokens()) { - tmp = tok.nextToken(); - if ((buffer.length() + tmp.length() + 1) < 60) { - buffer.append(" ").append(tmp); - } else { - labels.add(buffer.toString()); - buffer = new StringBuffer(); - buffer.append(tmp); - } - } - labels.add(buffer.toString()); - list = new String[labels.size()]; - for (int i = 0; i < labels.size(); i++) { - list[i] = labels.get(i).toString(); - } - showIt = new showProgress(list, true); - } - if (SwingUtilities.isEventDispatchThread()) { - showIt.run(); - } else { - try { - SwingUtilities.invokeAndWait(showIt); - } catch (Exception e) { - e.printStackTrace(); - progress(event.getMessage()); - } - } - }*/ + public void reportException(Exception e) { + String msg = translator.getString("Exception.Occured"); + setStatus(msg); + JOptionPane.showMessageDialog( + getContentPane(), + "" + msg + ":
" + + e.getClass().getName() + "
" + e.getMessage() + "", translator.getString("Exception.Error"), + JOptionPane.ERROR_MESSAGE + ); } - -} // class PreviewDialog +} diff --git a/src/org/apache/fop/viewer/PreviewDialogAboutBox.java b/src/org/apache/fop/viewer/PreviewDialogAboutBox.java index decee0666..ceb1a9105 100644 --- a/src/org/apache/fop/viewer/PreviewDialogAboutBox.java +++ b/src/org/apache/fop/viewer/PreviewDialogAboutBox.java @@ -7,80 +7,65 @@ package org.apache.fop.viewer; -/* - * originally contributed by - * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com - */ - - +//Java import java.awt.*; -import java.awt.event.*; import javax.swing.*; -import javax.swing.border.*; +import javax.swing.border.EmptyBorder; +import java.awt.event.ActionListener; +import java.awt.event.WindowEvent; +import java.awt.event.ActionEvent; +//FOP import org.apache.fop.apps.Version; - - +/** + * AWT Viewer's "About" dialog. + * Originally contributed by: + * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, + * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, + * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com + */ public class PreviewDialogAboutBox extends Dialog implements ActionListener { + private JButton okButton; - JPanel panel1 = new JPanel(); - JPanel panel2 = new JPanel(); - JPanel insetsPanel1 = new JPanel(); - JPanel insetsPanel2 = new JPanel(); - JPanel insetsPanel3 = new JPanel(); - JButton button1 = new JButton(); - JLabel imageControl1 = new JLabel(); - ImageIcon imageIcon; - JLabel label1 = new JLabel(); - JLabel label2 = new JLabel(); - JLabel label3 = new JLabel(); - JLabel label4 = new JLabel(); - BorderLayout borderLayout1 = new BorderLayout(); - BorderLayout borderLayout2 = new BorderLayout(); - FlowLayout flowLayout1 = new FlowLayout(); - FlowLayout flowLayout2 = new FlowLayout(); - GridLayout gridLayout1 = new GridLayout(); - String product = "FOP AWT-Preview"; - String version = "Version: " + Version.getVersion(); - String copyright = "See xml.apache.org"; - String comments = ""; // "Print Preview"; - - public PreviewDialogAboutBox(Frame parent) { - super(parent); + /** + * Creates modal "About" dialog, attached to a given parent frame. + */ + public PreviewDialogAboutBox(Frame parent, Translator translator) { + super(parent, true); enableEvents(AWTEvent.WINDOW_EVENT_MASK); - - // imageIcon = new ImageIcon(getClass().getResource("Hier der Grafikname")); - this.setTitle("Info"); + setTitle(translator.getString("About.Title")); setResizable(false); - panel1.setLayout(borderLayout1); - panel2.setLayout(borderLayout2); - insetsPanel1.setLayout(flowLayout1); - insetsPanel2.setLayout(flowLayout1); + JPanel panel1 = new JPanel(); + JPanel panel2 = new JPanel(); + JPanel insetsPanel1 = new JPanel(); + JPanel insetsPanel2 = new JPanel(); + JPanel insetsPanel3 = new JPanel(); + okButton = new JButton(); + JLabel imageControl1 = new JLabel(); + imageControl1.setIcon(new ImageIcon(getClass().getResource("Images/fop.gif"))); + JLabel label1 = new JLabel(translator.getString("About.Product")); + JLabel label2 = new JLabel(translator.getString("About.Version") + " " + Version.getVersion()); + JLabel label3 = new JLabel(translator.getString("About.Copyright")); + panel1.setLayout(new BorderLayout()); + panel2.setLayout(new BorderLayout()); + insetsPanel1.setLayout(new FlowLayout()); + insetsPanel2.setLayout(new FlowLayout()); insetsPanel2.setBorder(new EmptyBorder(10, 10, 10, 10)); - gridLayout1.setRows(4); - gridLayout1.setColumns(1); - label1.setText(product); - label2.setText(version); - label3.setText(copyright); - label4.setText(comments); - insetsPanel3.setLayout(gridLayout1); - insetsPanel3.setBorder(new EmptyBorder(10, 60, 10, 10)); - button1.setText("OK"); - button1.addActionListener(this); + insetsPanel3.setLayout(new GridLayout(3, 1)); + insetsPanel3.setBorder(new EmptyBorder(10, 10, 10, 10)); + okButton.setText(translator.getString("Button.Ok")); + okButton.addActionListener(this); insetsPanel2.add(imageControl1, null); panel2.add(insetsPanel2, BorderLayout.WEST); - this.add(panel1, null); - insetsPanel3.add(label1, null); - insetsPanel3.add(label2, null); - insetsPanel3.add(label3, null); - insetsPanel3.add(label4, null); + insetsPanel3.add(label1); + insetsPanel3.add(label2); + insetsPanel3.add(label3); panel2.add(insetsPanel3, BorderLayout.CENTER); - insetsPanel1.add(button1, null); + insetsPanel1.add(okButton); panel1.add(insetsPanel1, BorderLayout.SOUTH); panel1.add(panel2, BorderLayout.NORTH); + add(panel1); pack(); } @@ -96,10 +81,9 @@ public class PreviewDialogAboutBox extends Dialog implements ActionListener { } public void actionPerformed(ActionEvent e) { - if (e.getSource() == button1) { + if (e.getSource() == okButton) { cancel(); } } - } diff --git a/src/org/apache/fop/viewer/ProgressListener.java b/src/org/apache/fop/viewer/ProgressListener.java deleted file mode 100644 index b72fb7437..000000000 --- a/src/org/apache/fop/viewer/ProgressListener.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -/* - * originally contributed by - * Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, - * Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, - * Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com - */ - - -public interface ProgressListener { - public void progress(int percentage); - public void progress(String message); - public void progress(int percentage, String message); -} - diff --git a/src/org/apache/fop/viewer/SecureResourceBundle.java b/src/org/apache/fop/viewer/SecureResourceBundle.java deleted file mode 100644 index 2bbfc38e7..000000000 --- a/src/org/apache/fop/viewer/SecureResourceBundle.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -import java.util.*; -import java.io.*; - - -/** - * Die Klasse SecureResourceBundle ist ein Resourceundle, das im Falle eines fehlenden - * Eintrages keinen Absturz verursacht, sondern die Meldung - * Key key not found zurückgibt. - * - * @author Stanislav.Gorkhover@jCatalog.com - * @version 1.0 18.03.1999 - */ -public class SecureResourceBundle extends ResourceBundle - implements Translator { - - // Fehlende keys mit einer Meldung zurückgeben. - private boolean isMissingEmphasized = false; - - // private Properties lookup = new Properties(); - private LoadableProperties lookup = new LoadableProperties(); - - private boolean isSourceFound = true; - - public void setMissingEmphasized(boolean flag) { - isMissingEmphasized = flag; - } - - /** - * Kreiert ein ResourceBundle mit der Quelle in in. - */ - - public SecureResourceBundle(InputStream in) { - try { - lookup.load(in); - } catch (Exception ex) { - //log.error("Abgefangene Exception: " + ex.getMessage()); - isSourceFound = false; - } - } - - public Enumeration getKeys() { - return lookup.keys(); - } - - /** - * Händelt den abgefragten Key, liefert entweder den zugehörigen Wert oder eine Meldung. - * Die null wird nie zurückgegeben. - * Schreibt die fehlenden Suchschlüssel in die Protokoll-Datei. - * @return Object
    - *
  • den zu dem Suchschlüssel key gefundenen Wert, falls vorhanden,
    - *
  • Meldung Key key not found, falls der Suchschlüssel fehlt - * und die Eigenschaft "jCatalog.DevelopmentStartModus" in der ini-Datei aus true gesetzt ist. - *
  • Meldung Key is null, falls der Suchschlüssel null ist. - *
- * - */ - public Object handleGetObject(String key) { - - if (key == null) - return "Key is null"; - - Object obj = lookup.get(key); - if (obj != null) - return obj; - else { - if (isMissingEmphasized) { - //log.debug(getClass().getName() + ": missing key: " - // + key); - return getMissedRepresentation(key.toString()); - } else - return key.toString(); - } - } - - /** - * Stellt fest, ob es den Key gibt. - */ - public boolean contains(String key) { - return (key == null || lookup.get(key) == null) ? false : true; - } - - - private String getMissedRepresentation(String str) { - return ""; - } - - public boolean isSourceFound() { - return isSourceFound; - } -} - diff --git a/src/org/apache/fop/viewer/Translator.java b/src/org/apache/fop/viewer/Translator.java index 26e2cbaf7..f36c61789 100644 --- a/src/org/apache/fop/viewer/Translator.java +++ b/src/org/apache/fop/viewer/Translator.java @@ -5,35 +5,41 @@ * LICENSE file included with these sources. */ -package org.apache.fop.viewer; +package org.apache.fop.viewer; +//Java +import java.util.ResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; -/** - * Definition für die Übersetzer-Klassen. - * - * @version 03.12.99 - * @author Stanislav.Gorkhover@jCatalog.com - * +/** + * AWT Viewer's localization class, backed up by java.util.ResourceBundle. + * Originally contributed by: + * Stanislav.Gorkhover@jCatalog.com */ -public interface Translator { +public class Translator { + private ResourceBundle bundle; + private static String bundleBaseName = "org/apache/fop/viewer/resources/Viewer"; /** - * Übersetzt ein Wort. + * Default constructor, default Locale is used. */ - public String getString(String key); - - /** - * Ein Translator soll die fehlenden keys hervorheben können. - */ - public void setMissingEmphasized(boolean b); - - /** - * Gibt an ob die Übersetzungsquelle gefunden ist. + public Translator() { + this(Locale.getDefault()); + } + + /** + * Constructor for a given Locale. */ - public boolean isSourceFound(); + public Translator(Locale locale) { + bundle = ResourceBundle.getBundle(bundleBaseName, locale); + } /** - * Gibt an ob ein Key in der Übersetzungsquelle vorhanden ist. + * Returns localized String for a given key. */ - public boolean contains(String key); + public String getString(String key) { + return bundle.getString(key); + } } + diff --git a/src/org/apache/fop/viewer/UserMessage.java b/src/org/apache/fop/viewer/UserMessage.java deleted file mode 100644 index badf61ef9..000000000 --- a/src/org/apache/fop/viewer/UserMessage.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * $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. - */ - -package org.apache.fop.viewer; - -import java.awt.*; -import java.io.*; -import java.awt.event.*; -import java.util.*; -import javax.swing.*; -import javax.swing.JComponent.*; - - - -/** - * Klasse UserMessage ist ein utility zum Abfragen oder zum Informieren des Benutzers.
- * Eine Meldung besteht aus dem Identifikator (Suchschlüssel im Meldungspool), einem Dialogtitel, einem Buttonset und - * dem Meldungstext mit eventuellen Platzhaltern für die Parameter. - * - * @author S. Gorkhover - * @version 18.03.1999 - * - * @changed 23.04.99 Juergen.Verwohlt@jCatalog.com - * @subject Weitere Ausgabemethoden: show(String, String) und show(String,String,Frame) - * - * @changed 28.05.99 Juergen.Verwohlt@jCatalog.com - * @subject MessageException unterstützen - * - * @changed 09.06.99 Juergen.Verwohlt@jCatalog.com - * @subject Neue Klasse MessagesException zur Anzeige verwenden - * - * @changed 10.12.00 gears@apache.org - * @subject Unicode - */ -public class UserMessage { - - private static Translator res = null; - - public static void setTranslator(Translator aRes) { - res = aRes; - if (res == null) { - //log.debug("UserMessage: setTranslator(null) !"); - res = new SecureResourceBundle(null); - } - - MessagesDialog.setTranslator(res); - } - - - // Zulässige Werte für Dialogart: - - /** - * Möglicher Wert des Meldungstypes. Fenster-Title "Info" (de). - */ - private static final int INFO = JOptionPane.PLAIN_MESSAGE; - - /** - * Möglicher Wert des Meldungstypes. Fenster-Title "Warnung" (de). - */ - private static final int WARNING = JOptionPane.WARNING_MESSAGE; - - /** - * Möglicher Wert des Meldungstypes. Fenster-Title "Frage" (de). - */ - private static final int QUESTION = JOptionPane.QUESTION_MESSAGE; - - /** - * Möglicher Wert des Meldungstypes. Fenster-Title "Fehler" (de). - */ - private static final int ERROR = JOptionPane.ERROR_MESSAGE; - - /** - * Möglicher Wert des Meldungstypes. Fenster-Title "Systemfehler" (de). - */ - private static final int SYS_ERROR = JOptionPane.ERROR_MESSAGE; - - - - /* - * Style Constanten orientieren sich auf die - * Constanten der ButtonDialog-Klasse und legen das Dialog-ButtonSet fest. - */ - - /** - * Wert für Setzten keines Buttons - */ - public static final int STYLE_NOBUTTON = -2; - - /** - * Wert für Setzten von nur Ja-Button. - */ - public static final int STYLE_Y = JOptionPane.DEFAULT_OPTION; - // ButtonDialog.YES; // = 1 - - /** - * Wert für Setzten von Ja- und Nein-Buttons. - */ - public static final int STYLE_Y_N = JOptionPane.YES_NO_OPTION; - // ButtonDialog.YES_NO; // = 2; - - /** - * Wert für Setzten von Ja-, Nein-und Abbruch Buttons. - */ - public static final int STYLE_Y_N_C = JOptionPane.YES_NO_CANCEL_OPTION; - // ButtonDialog.YES_NO_CANCEL; // = 3; - - - // Platzhalter für Parameter in der Properties-Datei - private static final String PARAMETER_TAG = "&&&"; - - - /** - * Benutzer-Antwort-Constanten orientieren sich auf die - * Constanten der ButtonDialog-Klasse - */ - - /** - * Möglicher Rückgabewert @see ButtonDialog - */ - public static final int YES = JOptionPane.YES_OPTION; - // ButtonDialog.YES; // = 2 - - /** - * Möglicher Rückgabewert @see ButtonDialog - */ - public static final int NO = JOptionPane.NO_OPTION; - // ButtonDialog.NO; // = 4; - - /** - * Möglicher Rückgabewert @see ButtonDialog - */ - public static final int CANCEL = JOptionPane.CANCEL_OPTION; - // ButtonDialog.CANCEL; // = 8; - - - // Default-Values - private static int buttonType = STYLE_Y; - private static int iconType = WARNING; - private static String currentIconName = ""; - private static String actMessId = null; - // private static MessagesDialog nobuttonDialog = null; - - - /** - * Ersetzt die eventuellen Platzhalter durch die übergebenen Parameter - */ - static String prepareMessage(String rawText, String[] par) { - //log.debug("prepareMessage(): " + rawText + ", parameter: " - // + par); - int index = rawText.indexOf(PARAMETER_TAG); - String composedMess = ""; - if ((index == -1) && (par == null)) - return rawText; - if ((index != -1) && (par == null)) { - //log.debug("Message " + actMessId - // + " erwartet Parameter. Aufgerufen ohne Parameter"); - return rawText; - } - if ((index == -1) && (par != null)) { - //log.debug("Message " + actMessId - // + " erwartet keine Parameter. Aufgerufen mit folgenden Parametern:"); - for (int i = 0; i < par.length; ++i) { - //log.debug(par[i].toString()); - } - return rawText; - } - int tagCount = 0; - while (rawText.indexOf(PARAMETER_TAG) != -1) { - index = rawText.indexOf(PARAMETER_TAG); - try { - composedMess += rawText.substring(0, index) + par[tagCount]; - } catch (ArrayIndexOutOfBoundsException ex) { - //log.error("Anzahl der übergebenen Parameter zu der Meldung " - // + actMessId - // + " ist weniger als erwartet.", ex); - return composedMess + rawText; - } - rawText = rawText.substring(index + PARAMETER_TAG.length()); - tagCount++; - } - composedMess += rawText; - if (tagCount != par.length) { - //log.debug("Die zu der Meldung " + actMessId - // + " übergebenen Parameter sind mehr als die Meldung vorsieht."); - } - return composedMess; - } - - /** - * Gibt den Title fürs Dialogfenster. - * Dieser wird durch die Dialogart festgelegt - * (erster Teil in der MeldungsDefinition in der Properties-Datei). - */ - static String getTitle(String strVal) { - String title = null; - int choice = getValue(strVal); - switch (choice) { - case INFO: - title = "Info"; - currentIconName = "info.gif"; - break; - case WARNING: - title = "Warning"; - currentIconName = "warn.gif"; - break; - case QUESTION: - title = "Question"; - currentIconName = "quest.gif"; - break; - case ERROR: - title = "Error"; - currentIconName = "error.gif"; - break; - default: - title = - "Ungültiger IonType für diese Meldung. Prüfen in Übersetzungsdatei."; - } - return title; - } - - /** - * Liefert den Wert der über den Nemen übergebenen Klassenvariablen. - */ - static int getValue(String fieldName) { - - int val = -1; - if (fieldName.equals("INFO")) - return INFO; - else if (fieldName.equals("WARNING")) - return WARNING; - else if (fieldName.equals("ERROR")) - return ERROR; - else if (fieldName.equals("SYS_ERROR")) - return SYS_ERROR; - else if (fieldName.equals("QUESTION")) - return QUESTION; - else if (fieldName.equals("STYLE_NOBUTTON")) - return STYLE_NOBUTTON; - else if (fieldName.equals("STYLE_Y")) - return STYLE_Y; - else if (fieldName.equals("STYLE_Y_N")) - return STYLE_Y_N; - else if (fieldName.equals("STYLE_Y_N_C")) - return STYLE_Y_N_C; - return val; - } - - private static String getStackTrace(Exception exception) { - - if (exception == null) - return "null"; - - String stack = ""; - - StringWriter strWriter = new StringWriter(); - exception.printStackTrace(new PrintWriter(strWriter)); - stack = strWriter.toString(); - stack = stack.replace('\r', ' '); - stack = stack.replace('\t', ' '); - return stack; - } - - private static int display(String textID, String[] param, - Exception exception, Frame frame) { - - String translatedMes = ""; - String preparedMes = ""; - String messageType = ""; - String optionType = ""; - String title = ""; - MessagesDialog dialog = null; - actMessId = textID; - - boolean messageFound = res.contains(textID); - translatedMes = res.getString(textID); - - if (messageFound) { - try { - messageType = - translatedMes.substring(0, translatedMes.indexOf(':')); - translatedMes = - translatedMes.substring(translatedMes.indexOf(':') + 1); - - optionType = - translatedMes.substring(0, translatedMes.indexOf(':')); - translatedMes = - translatedMes.substring(translatedMes.indexOf(':') + 1); - - } catch (Exception ex) { - //log.debug("FALSCHES FORMAT: MESSAGE: " + textID); - } - } else { // Message not found - //log.debug("UserMessage: textID '" + textID - // + "' not found. Return " - // + "value 'CANCEL' = " + CANCEL); - - // return CANCEL; - - messageType = "ERROR"; - optionType = "STYLE_Y"; - translatedMes = "textID '" + textID + "' not found." - + "\nIt is possible the message file not found."; - } - - preparedMes = prepareMessage(translatedMes, param); - // Exception exception = getException(param); - - // WARNING -> nach Warnung übersetzen - title = res.getString(getTitle(messageType)); - - // WARNING -> JOptionPane.WARNING_MESSAGE - int messageTypeIndex = getValue(messageType); - - // Button Set idetifizieren - int optionTypeIndex = getValue(optionType); - - int result = CANCEL; - - if (exception != null) { - String str = getStackTrace(exception); - if (exception instanceof MessageException) { - MessageException ex = (MessageException)exception; - if (ex.getException() != null) - str += "\n" + getStackTrace(ex.getException()); - } - result = MessagesDialog.showDetailDialog(null, preparedMes, - title, optionTypeIndex, - messageTypeIndex, null, - str); - } else { - if (optionTypeIndex == STYLE_NOBUTTON) { - // Wird nicht mehr unterstützt - //log.debug("UserMessage: STYLE_NOBUTTON wird nicht unterstützt"); - return result; - } else { - result = MessagesDialog.showConfirmDialog(null, preparedMes, - title, - optionTypeIndex, - messageTypeIndex); - } - } - return result; - } - - /** - * Öffnet das Dialogfenster mit der Übersetzung der per Suchschlüssel übergebenen Meldung - * mit eingesetzten Parametern. Für die Übersetzung der Parameter trägt die aufrufende Stelle die Sorge. - * Der Dialog ist modal zum Frame frame. - * @param
    - *
  • textID - Suchschlüssel der Meldung im Meldungspool, - *
  • param - Array der in die Meldung einzusetztenden Parameter, - *
  • frame - das Fenster, zu dem der Dialog modal ist. - *
- * @return
    - *
  • -1 wenn keine Rückgabe möglich ist oder Dialog NICHT MODAL ist. - *
  • ButtonDialog.YES = 2 - *
  • ButtonDialog.NO = 4 - *
  • ButtonDialog.CANCEL = 8 - *
  • Wird das Dialog-Fenster ohne Buttonklick geschlossen (Kreuzchen oben rechts), so ist die Rückgabe gleich ButtonDialog.CANCEL. - *
- */ - public static int show(String messageId, String[] parameterList, - Exception anException, Frame parentFrame) { - return display(messageId, parameterList, anException, parentFrame); - } - - public static int show(String messageId, String[] parameterList, - Exception anException) { - return display(messageId, parameterList, anException, (Frame)null); - } - - public static int show(String messageId, String[] parameterList, - Frame parentFrame) { - return display(messageId, parameterList, (Exception)null, - parentFrame); - } - - public static int show(String messageId, String[] parameterList) { - return display(messageId, parameterList, (Exception)null, - (Frame)null); - } - - public static int show(String messageId, String parameter, - Frame parentFrame) { - return display(messageId, new String[] { - parameter - }, (Exception)null, parentFrame); - } - - public static int show(String messageId, String parameter) { - return display(messageId, new String[] { - parameter - }, (Exception)null, (Frame)null); - } - - public static int show(String messageId, Frame parentFrame) { - return display(messageId, (String[])null, (Exception)null, - parentFrame); - } - - public static int show(String messageId) { - return display(messageId, (String[])null, (Exception)null, - (Frame)null); - } - - public static int show(String messageId, Exception anException, - Frame aFrame) { - return display(messageId, (String[])null, anException, aFrame); - } - - public static int show(String messageId, Exception anException) { - return display(messageId, (String[])null, anException, (Frame)null); - } - - public static int show(Exception anException, Frame aFrame) { - if (anException instanceof MessageException) { - MessageException ex = (MessageException)anException; - return show(ex.getMessageId(), ex.getParameterList(), ex, aFrame); - } else - return show("UNHANDLED_EXCEPTION", (String[])null, anException, - aFrame); - } - -} - diff --git a/src/org/apache/fop/viewer/resources/Viewer.properties b/src/org/apache/fop/viewer/resources/Viewer.properties new file mode 100644 index 000000000..8c44d7a4d --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer.properties @@ -0,0 +1,43 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Default bundle. +# +Menu.File=File +Menu.Exit=Exit +Menu.View=View +Menu.First.page=First page +Menu.Prev.page=Previous page +Menu.Next.page=Next page +Menu.Last.page=Last page +Menu.Go.to.Page=Go to Page +Menu.Help=Help +Menu.Default.zoom=Default zoom +Menu.About=About +Menu.Print=Print +Menu.Zoom=Zoom +Menu.Reload=Reload + +Title.Preview=Preview + +Status.Show=Show +Status.Page=Page +Status.of=of +Status.Build.FO.tree=Build FO tree... + +Exception.Occured=An exception has occured +Exception.Error=Fatal error + +Label.Page.number=Page number +Button.Ok=Ok +Button.Cancel=Cancel + +About.Product=FOP AWT Viewer +About.Version=Version: +About.Copyright=See http://xml.apache.org/fop +About.Title=About \ No newline at end of file diff --git a/src/org/apache/fop/viewer/resources/Viewer_cs.properties b/src/org/apache/fop/viewer/resources/Viewer_cs.properties new file mode 100644 index 000000000..d668e1292 --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_cs.properties @@ -0,0 +1,34 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Czech bundle. +# +Menu.File=Soubor +Menu.Print=Tisk +Menu.Exit=Konec +Menu.View=Zobrazit +Menu.First.page=Prvn\u00ed strana +Menu.Prev.page=P\u0159edchoz\u00ed strana +Menu.Next.page=Dal\u0161\u00ed strana +Menu.Last.page=Posledn\u00ed strana +Menu.Zoom=Lupa +Menu.Default.zoom=Standardn\u00ed lupa +Menu.Help=N\u00e1pov\u011bda +Menu.About=O aplikaci +Menu.Reload=Obnovit +Menu.Go.to.Page=Jdi na stranu + +Title.Preview=N\u00e1hled + +Status.Show=Zobrazen\u00ed +Status.Page=Strana +Status.of=z +Status.Build.FO.tree=Vytv\u00e1\u0159\u00edm strom FO... + +Label.Page.number=Strana \u010d\u00edslo +Button.Cancel=Zru\u0161it diff --git a/src/org/apache/fop/viewer/resources/Viewer_de.properties b/src/org/apache/fop/viewer/resources/Viewer_de.properties new file mode 100644 index 000000000..62ff16eb5 --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_de.properties @@ -0,0 +1,32 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. German bundle. +# +Menu.File=Datei +Menu.Exit=Beenden +Menu.View=Anzeige +Menu.First.page=Erste Seite +Menu.Prev.page=Vorherige Seite +Menu.Next.page=N\u00e4chste Seite +Menu.Last.page=Letzte Seite +Menu.Help=Hilfe +Menu.Default.zoom=Standardzoom +Menu.About=\u00dcber +Menu.Print=Drucken +Menu.Go.to.Page=Gehe zur Seite + +Title.Preview=Vorschau + +Status.Show=Anzeigen +Status.Page=Seite +Status.of=von +Status.Build.FO.tree=Baue FO-Baum + +Button.Cancel=Abbrechen +Label.Page.number=Seitennummer \ No newline at end of file diff --git a/src/org/apache/fop/viewer/resources/Viewer_fi.properties b/src/org/apache/fop/viewer/resources/Viewer_fi.properties new file mode 100644 index 000000000..4068aad5d --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_fi.properties @@ -0,0 +1,23 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Finnish bundle. +# +Menu.File=Tiedosto +Menu.Print=Tulosta +Menu.Exit=Poistu +Menu.View=N\u00e4yt\u00e4 +Menu.First.page=Ensimm\u00e4inen sivu +Menu.Prev.page=Edellinen sivu +Menu.Next.page=Seuraava sivu +Menu.Last.page=Viimeinen sivu +Menu.Default.zoom=Normaali zoom +Menu.Help=Ohje +Menu.About=Tietoja + +Status.Page=Sivu diff --git a/src/org/apache/fop/viewer/resources/Viewer_fr.properties b/src/org/apache/fop/viewer/resources/Viewer_fr.properties new file mode 100644 index 000000000..89bb37a64 --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_fr.properties @@ -0,0 +1,21 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. French bundle. +# +Menu.File=Fichier +Menu.Print=Imprimer +Menu.Exit=Quitter +Menu.View=Affichage +Menu.First.page=Premi\u00e8re page +Menu.Prev.page=Page pr\u00e9c\u00e9dente +Menu.Next.page=Page suivante +Menu.Last.page=Derni\u00e8re page +Menu.Help=Aide +Menu.Default.zoom=Zoom par d\u00e9faut +Menu.About=A propos diff --git a/src/org/apache/fop/viewer/resources/Viewer_it.properties b/src/org/apache/fop/viewer/resources/Viewer_it.properties new file mode 100644 index 000000000..fd1bd39e1 --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_it.properties @@ -0,0 +1,21 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Italian bundle. +# +Menu.File=File +Menu.Exit=Esci +Menu.View=Vista +Menu.First.page=Prima pagina +Menu.Prev.page=Pagina precedente +Menu.Next.page=Pagina seguente +Menu.Last.page=Ultima pagina +Menu.Help=Aiuto +Menu.Default.zoom=Zoom di default +Menu.About=Riguardo a... +Menu.Print=Stampa diff --git a/src/org/apache/fop/viewer/resources/Viewer_ja.properties b/src/org/apache/fop/viewer/resources/Viewer_ja.properties new file mode 100644 index 000000000..983a72dcb --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_ja.properties @@ -0,0 +1,28 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Japanese bundle. +# +Menu.File=\u30d5\u30a1\u30a4\u30eb +Menu.Print=\u5370\u5237 +Menu.Exit=\u7d42\u4e86 +Menu.View=\u8868\u793a +Menu.First.page=\u958b\u59cb\u30da\u30fc\u30b8 +Menu.Prev.page=\u524d\u30da\u30fc\u30b8 +Menu.Next.page=\u6b21\u30da\u30fc\u30b8 +Menu.Last.page=\u6700\u7d42\u30da\u30fc\u30b8 +Menu.Go.to.Page=\u30da\u30fc\u30b8\u6307\u5b9a +Menu.Zoom=\u30ba\u30fc\u30e0 +Menu.Default.zoom=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ba\u30fc\u30e0 +Menu.Help=\u30d8\u30eb\u30d7 +Menu.About=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831 + +Status.Page=\u30da\u30fc\u30b8 +Status.of=/ +Status.Build.FO.tree=FO\u30c4\u30ea\u30fc\u69cb\u7bc9\u4e2d +Status.Show=\u5b8c\u4e86 diff --git a/src/org/apache/fop/viewer/resources/Viewer_pl.properties b/src/org/apache/fop/viewer/resources/Viewer_pl.properties new file mode 100644 index 000000000..63bf2de9f --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_pl.properties @@ -0,0 +1,24 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Polish bundle. +# +Menu.File=Plik +Menu.Print=Drukuj +Menu.Exit=Zako\u00f1cz +Menu.View=Widok +Menu.First.page=Pierwsza strona +Menu.Prev.page=Poprzednia strona +Menu.Next.page=Nast\u00eapna strona +Menu.Last.page=Ostatnia strona +Menu.Zoom=Powi\u00eakszenie +Menu.Default.zoom=Domy\u00b6lne powiekszenie +Menu.Help=Pomoc +Menu.About=O programie + +Status.Page=Strona diff --git a/src/org/apache/fop/viewer/resources/Viewer_ru.properties b/src/org/apache/fop/viewer/resources/Viewer_ru.properties new file mode 100644 index 000000000..509f22935 --- /dev/null +++ b/src/org/apache/fop/viewer/resources/Viewer_ru.properties @@ -0,0 +1,43 @@ +############################################################################# +# Copyright (C) The Apache Software Foundation. All rights reserved. # +# ------------------------------------------------------------------------- # +# This software is published under the terms of the Apache Software License # +# version 1.1, a copy of which has been included with this distribution in # +# the LICENSE file. # +############################################################################# +# +# AWT viewer's GUI resources. Russain bundle. +# +Menu.File=\u0424\u0430\u0439\u043b +Menu.Exit=\u0412\u044b\u0445\u043e\u0434 +Menu.View=\u0412\u0438\u0434 +Menu.First.page=\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 +Menu.Prev.page=\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 +Menu.Next.page=\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 +Menu.Last.page=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 +Menu.Go.to.Page=\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 +Menu.Help=\u041f\u043e\u043c\u043e\u0449\u044c +Menu.Default.zoom=\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 +Menu.About=\u041e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 +Menu.Print=\u041f\u0435\u0447\u0430\u0442\u044c +Menu.Zoom=\u0420\u0430\u0437\u043c\u0435\u0440 +Menu.Reload=\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c + +Title.Preview=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 + +Status.Show=\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 +Status.Page=\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 +Status.of=\u0438\u0437 +Status.Build.FO.tree=\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 FO \u0434\u0435\u0440\u0435\u0432\u0430... + +Exception.Occured=\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 +Exception.Error=\u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 + +Label.Page.number=\u041d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b +Button.Ok=Ok +Button.Cancel=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c + +About.Product=FOP AWT Viewer +About.Version=\u0412\u0435\u0440\u0441\u0438\u044f: +About.Copyright=\u0421\u043c\u043e\u0442\u0440\u0438 http://xml.apache.org/fop +About.Title=\u041e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 diff --git a/src/org/apache/fop/viewer/resources/messages.de b/src/org/apache/fop/viewer/resources/messages.de deleted file mode 100644 index 8db0001a8..000000000 --- a/src/org/apache/fop/viewer/resources/messages.de +++ /dev/null @@ -1,78 +0,0 @@ -############################################################################### -# -# In dieser Datei werden im Abschnitt "Messages" Meldungen auf deutsch -# definiert. -# Zu beachten: Beim Definieren einer neuen neuen Meldung, diese soweit möglich -# in allen Sprachen anlegen. -# -# -# -# MELDUNG DEFINIEREN -# ================== -# -# Eine Meldung hat eine eindeutige textuelle ID. Diese steht links vom Gleichheitszeichen. -# Zu jeder Meldung wird angegeben: -# - iconType (Typen siehe unten) -# - buttonType (Typen siehe unten) -# - Meldungstext mit evtl. Platzhaltern für Parameter. -# -# Ein Parameterplatzhalter ist ein dreifaches kaumänisches "und". Siehe Beispielmeldung -# "No_Records_found". -# -# Die Angaben erfolgen in einer Zeile, jeweils durch einen Doppelpunkt getrennt. -# -# Format: -# =:: -# -# Zulässige Werte für: -# iconType: -# INFO -# WARNING -# ERROR -# QUESTION -# -# buttonType: -# STYLE_Y ("yes" Button) -# STYLE_Y_N ("yes" and "no" Buttons) -# STYLE_Y_N_C ("yes", "no" and "cancel" Buttons) -# -# -# Beispiel mit einem String-Array: -# ================================ -# Messagedefinition: -# No_Records_found=WARNING:STYLE_Y:Die Tabelle &&& enthält keinen Eintrag. Erwartet mind. &&&. Weitermachen? -# Aufruf: -# answer = UserMessage.show("No_Records_found", new String[] {"Mitarbeiter", "" + minNumber}, aShowFrame); -# if (answer == UserMessage.NO) -# return; -# -# Beispiel mit einer Exception: -# ============================= -# Messagedefinition: -# UNEXPECTED_EXCEPTION=ERROR:STYLE_Y:Wow! An exception! -# -# Aufruf: -# try { -# String str = null; -# int index = str.indexOf("abc"); -# } catch (Exception ex) { -# UserMessage.show("UNEXPECTED_EXCEPTION", ex); -# } -# -# -# -# -################################################################################################# - - -# Titles -Info=Info -Warning=Warnung -Question=Frage -Error=Fehler - -# Messages -TRANSLATION_SOURCE_NOT_FOUND=WARNING:STYLE_Y:Die Übersetzungsdatei &&& ist nicht gefunden. -UNKNOWN_EXCEPTION=ERROR:STYLE_Y:Unbekannter Fehler -UNHANDLED_EXCEPTION=ERROR:STYLE_Y:Interner Fehler - diff --git a/src/org/apache/fop/viewer/resources/messages.en b/src/org/apache/fop/viewer/resources/messages.en deleted file mode 100644 index 7e8953845..000000000 --- a/src/org/apache/fop/viewer/resources/messages.en +++ /dev/null @@ -1,80 +0,0 @@ -############################################################################### -# -# This file contains the english messages. -# -# NOTICE: When defining a new message it has to be created in message files for each language. -# -# -# -# -# DEFINING A MESSAGE -# ================== -# -# A message has a uinique CHARACTER ID. It is placed on the left hand side of the equation. -# For each message there are additional switches: -# - iconType (see below) -# - buttonType (see below) -# - messageText may contain placeholders for parameters. - -# A placeholder pattern is a "&&&" . See Examplemessage "No_Records_found". -# -# A messsage definition is placed within a single row, its switches are seperated by a colon ":". -# -# Format: -# ======= -# =:: -# -# -# Allowed values for: -# =================== -# iconType: -# INFO -# WARNING -# ERROR -# QUESTION -# -# buttonType: -# STYLE_Y ("yes" Button) -# STYLE_Y_N ("yes" and "no" Buttons) -# STYLE_Y_N_C ("yes", "no" and "cancel" Buttons) -# -# -# Example with a parameter array: -# ================================ -# Message definition: -# No_Records_found=WARNING:STYLE_Y:The Table &&& has no records. Expected at least &&&. Continue? -# Aufruf: -# answer = UserMessage.show("No_Records_found", new String[] {"Employee", "" + minNumber}, aShowFrame); -# if (answer == UserMessage.NO) -# return; -# -# Example with an Exception: -# ============================= -# Message definition: -# UNEXPECTED_EXCEPTION=ERROR:STYLE_Y:Wow! An exception! -# -# Aufruf: -# try { -# String str = null; -# int index = str.indexOf("abc"); -# } catch (Exception ex) { -# UserMessage.show("UNEXPECTED_EXCEPTION", ex); -# } -# -# -# -# -################################################################################################# - - -# Titles -Info=Info -Warning=Warning -Question=Question -Error=Error - -# Messages -TRANSLATION_SOURCE_NOT_FOUND=WARNING:STYLE_Y:The translation file &&& is not found. -UNKNOWN_EXCEPTION=ERROR:STYLE_Y:Unknown error. -UNHANDLED_EXCEPTION=ERROR:STYLE_Y:Internal error. - diff --git a/src/org/apache/fop/viewer/resources/resources.de b/src/org/apache/fop/viewer/resources/resources.de deleted file mode 100644 index 400a326ba..000000000 --- a/src/org/apache/fop/viewer/resources/resources.de +++ /dev/null @@ -1,45 +0,0 @@ -File=Datei - -Exit=Beenden - -View=Anzeige - -Previous page=Vorherige Seite - -Next page=Nächste Seite - -Last page=Letzte Seite - -Help=Hilfe - -Default zoom=Standardzoom - -Introduction=Einleitung - -About=Über - -Show=Anzeigen - -Preview=Vorschau - -First page=Erste Seite - -Print=Drucken - -Page=Seite - -of=von - -Init parser=Initializiere Parser - -Init mappings=Initializiere Abbildung - -Build FO tree=Baue FO-Baum - -Layout FO tree=Formatiere FO-Baum - -Render=Gebe aus - -Close=Schließen - -Go to Page=Gehe zur Seite diff --git a/src/org/apache/fop/viewer/resources/resources.en b/src/org/apache/fop/viewer/resources/resources.en deleted file mode 100644 index acf0ef669..000000000 --- a/src/org/apache/fop/viewer/resources/resources.en +++ /dev/null @@ -1,4 +0,0 @@ -# Diese Datei ist nur dafür da, daß die Warnung -# "Übersetzungsdatei nicht gefunden" nicht hochkommt. -# Die Suchschlüssel für die zu übersetzenden Begriffe sind -# englisch. Daher wäre eine Übersetzung redundant. diff --git a/src/org/apache/fop/viewer/resources/resources.fi b/src/org/apache/fop/viewer/resources/resources.fi deleted file mode 100644 index 97219031d..000000000 --- a/src/org/apache/fop/viewer/resources/resources.fi +++ /dev/null @@ -1,16 +0,0 @@ -File=Tiedosto -Print=Tulosta -Exit=Poistu -View=Näytä -First page=Ensimmäinen sivu -Previous page=Edellinen sivu -Next page=Seuraava sivu -Last page=Viimeinen sivu -Default zoom=Normaali zoom -Help=Ohje -Index=Sisällys -Introduction=Esittely -About=Tietoja -Page=Sivu - - diff --git a/src/org/apache/fop/viewer/resources/resources.fr b/src/org/apache/fop/viewer/resources/resources.fr deleted file mode 100644 index 5287dcbb9..000000000 --- a/src/org/apache/fop/viewer/resources/resources.fr +++ /dev/null @@ -1,13 +0,0 @@ -File=Fichier -Print=Imprimer -Exit=Quitter -View=Affichage -First page=Première page -Previous page=Page précédente -Next page=Page suivante -Last page=Dernière page -Help=Aide -Default zoom=Zoom par défaut -Introduction=Introduction -About=A propos - diff --git a/src/org/apache/fop/viewer/resources/resources.it b/src/org/apache/fop/viewer/resources/resources.it deleted file mode 100644 index 05cdb0a0a..000000000 --- a/src/org/apache/fop/viewer/resources/resources.it +++ /dev/null @@ -1,14 +0,0 @@ -File=File -Exit=Esci -View=Vista -First page=Prima pagina -Previous page=Pagina precedente -Next page=Pagina seguente -Last page=Ultima pagina -Help=Aiuto -Default zoom=Zoom di default -Introduction=Introduzione -About=Riguardo a... -Index=Indice -Print=Stampa - diff --git a/src/org/apache/fop/viewer/resources/resources.pl b/src/org/apache/fop/viewer/resources/resources.pl deleted file mode 100644 index 9b727e151..000000000 --- a/src/org/apache/fop/viewer/resources/resources.pl +++ /dev/null @@ -1,17 +0,0 @@ -File=Plik -Print=Drukuj -Exit=Zakoñcz -View=Widok -First page=Pierwsza strona -Previous page=Poprzednia strona -Next page=Nastêpna strona -Last page=Ostatnia strona -Zoom=Powiêkszenie -Default zoom=Domy¶lne powiekszenie -Help=Pomoc -Index=Indeks -Introduction=Wstêp -About=O programie -Page=Strona - - diff --git a/src/org/apache/fop/viewer/resources/resources.ru b/src/org/apache/fop/viewer/resources/resources.ru deleted file mode 100644 index 84309253e..000000000 --- a/src/org/apache/fop/viewer/resources/resources.ru +++ /dev/null @@ -1,38 +0,0 @@ -File=Ôàéë - -Exit=Çàêîí÷èòü - -View=Âèä - -First page=Ïåðâàÿ ñòðàíèöà - -Previous page=Ïðåäûäóùàÿ ñòðàíèöà - -Next page=Ñëåäóþùàÿ ñòðàíèöà - -Last page=Ïîñëåäíÿÿ ñòðàíèöà - -Go to Page=Èäòè ê ñòðàíèöå - -Help=Ïîìîùü - -Default zoom=Ñòàíäàðòíûé ìàñøòàá - -Introduction=Ââåäåíèå - -About=Î ïðîãðàììå - -Show=Ïîêàç - -Preview=Ïðîñìîòð - -Print=Ïå÷àòàòü - -Page=Ñòðàíèöà - -of=èç - -Zoom=Ìàñøòàá - -Close=Çàêðûòü - -- 2.39.5