aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-08-10 15:43:13 +0000
committerGlen Mazza <gmazza@apache.org>2003-08-10 15:43:13 +0000
commit8303819b1d47c029980d9cfd14590565719d4c51 (patch)
tree5560b29da9e4093887eaaa4571d1ae022a6ed553 /src/java/org/apache/fop/render
parent9936fde9ef443170aadeba3a42083a0bd0226d08 (diff)
downloadxmlgraphics-fop-8303819b1d47c029980d9cfd14590565719d4c51.tar.gz
xmlgraphics-fop-8303819b1d47c029980d9cfd14590565719d4c51.zip
Moved the Translator (resource bundle) creation from AWTStarter to AWTRenderer.
Gave the AWTRenderer access to the PrintViewer frame that displays the document. Moved rendering status messages from AWTStarter to AWTRenderer and PrintDialog. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196779 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render')
-rw-r--r--src/java/org/apache/fop/render/awt/AWTPrintRenderer.java2
-rw-r--r--src/java/org/apache/fop/render/awt/AWTRenderer.java38
2 files changed, 25 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/render/awt/AWTPrintRenderer.java b/src/java/org/apache/fop/render/awt/AWTPrintRenderer.java
index 189ec1481..9e2510caa 100644
--- a/src/java/org/apache/fop/render/awt/AWTPrintRenderer.java
+++ b/src/java/org/apache/fop/render/awt/AWTPrintRenderer.java
@@ -68,7 +68,7 @@ public class AWTPrintRenderer extends AWTRenderer {
private PrinterJob printerJob;
public AWTPrintRenderer() {
- super(null);
+ super();
initialize();
}
diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java
index d4700233a..d46fca157 100644
--- a/src/java/org/apache/fop/render/awt/AWTRenderer.java
+++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java
@@ -72,6 +72,7 @@ import java.util.Map;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.render.AbstractRenderer;
+import org.apache.fop.viewer.PreviewDialog;
import org.apache.fop.viewer.Translator;
/**
@@ -85,7 +86,11 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
protected int pageNumber = 0;
protected List pageList = new java.util.Vector();
//protected ProgressListener progressListener = null;
- protected Translator res = null;
+
+ /**
+ * The resource bundle used for AWT messages.
+ */
+ protected Translator translator = null;
protected Map fontNames = new java.util.Hashtable();
protected Map fontStyles = new java.util.Hashtable();
@@ -100,7 +105,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
/**
* The current (internal) font name
- */
+ */
protected String currentFontName;
/**
@@ -116,14 +121,18 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
protected float currentBlue = 0;
/**
- * The parent component, used to set up the font.
- * This is needed as FontSetup needs a live AWT component
- * in order to generate valid font measures.
+ * The preview dialog frame used for display of the documents.
+ * Also used as the AWT Component for FontSetup in generating
+ * valid font measures.
*/
- protected Component parent;
+ protected PreviewDialog frame;
+
+ public AWTRenderer() {
+ translator = new Translator();
+ }
- public AWTRenderer(Translator aRes) {
- res = aRes;
+ public Translator getTranslator() {
+ return translator;
}
public int getPageCount() {
@@ -138,13 +147,12 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
}
/**
- * Sets parent component which is used to set up the font.
- * This is needed as FontSetup needs a live AWT component
- * in order to generate valid font measures.
- * @param parent the live AWT component reference
+ * Sets the preview dialog frame used for display of the documents.
+ * @param frame the PreviewDialog frame
*/
- public void setComponent(Component parent) {
- this.parent = parent;
+ public void setPreviewDialog(PreviewDialog frame) {
+ this.frame = frame;
+ frame.setStatus(translator.getString("Status.Build.FO.tree"));
}
public int getPageNumber() {
@@ -173,6 +181,8 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
public void stopRenderer()
throws IOException {
+ frame.setStatus(translator.getString("Status.Show"));
+ frame.showPage();
}
// Printable Interface