*/
package org.apache.fop.fo;
+import java.awt.GraphicsEnvironment;
import java.awt.geom.Rectangle2D;
import java.util.BitSet;
import java.util.HashMap;
/** The number of markers on this FO. */
protected int numMarkers = 0;
+ private GraphicsEnvironment gEnv = null;
+ protected GraphicsEnvironment getGraphicsEnvironment() {
+ return gEnv;
+ }
/**
* @param foTree an <tt>FOTree</tt> to which this node belongs
* @param type the fo type of this FONode.
exprParser = foTree.exprParser;
propertySet = new PropertyValue[PropNames.LAST_PROPERTY_INDEX + 1];
foAttributes = new FOAttributes(event, this);
+ if (parent == null) {
+ // Setup the graphics environment
+ gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ } else {
+ gEnv = parent.getGraphicsEnvironment();
+ }
if ((stateFlags & MC_MARKER) == 0) {
processAttributes();
}
import java.util.Arrays;
import java.util.NoSuchElementException;
-
import org.apache.fop.apps.FOPException;
import org.apache.fop.area.Area;
import org.apache.fop.datastructs.TreeException;
package org.apache.fop.fo.flow;
// FOP
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.font.FontRenderContext;
+import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
{
super(foTree, FObjectNames.PAGE_SEQUENCE, parent, event,
FONode.PAGESEQ_SET, sparsePropsMap, sparseIndices);
+ // Set up the graphics environment
+ pageSpread =
+ new BufferedImage(20*72, 12*72, BufferedImage.TYPE_INT_RGB);
+ g2D = pageSpread.createGraphics();
+ frcontext = g2D.getFontRenderContext();
+
XmlEvent ev;
// Look for optional title
log.finer("page-sequence title");
makeSparsePropsSet();
}
+ private GraphicsEnvironment gEnv = null;
+ public GraphicsEnvironment getGraphicsEnvironment() {
+ return gEnv;
+ }
+ private BufferedImage pageSpread = null;
+ public BufferedImage getPageSpread() {
+ return pageSpread;
+ }
+ private Graphics2D g2D = null;
+ public Graphics2D getGraphics2D() {
+ return g2D;
+ }
+ private FontRenderContext frcontext = null;
+ public FontRenderContext getFontRenderContext() {
+ return frcontext;
+ }
+
public Area getReferenceRectangle() throws FOPException {
// TODO Reference rectangle is assumed to be equivalent to the
// "auto" value on "page-height" and "page-width". The
return characters;
}
+ // PCDATA provides sequences of inline-areas to fill line-areas in the
+ // parent block area.
+ // Generate a text-layout for the PCDATA.
+ /**
+ * Generate a
+ */
+ private void processText() {
+
+ }
+
}
GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fonts = gEnv.getAllFonts();
String[] families = gEnv.getAvailableFontFamilyNames();
- BufferedImage fontImage =
- new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
- Graphics2D g2D = fontImage.createGraphics();
+ BufferedImage pageSpread =
+ new BufferedImage(20*72, 12*72, BufferedImage.TYPE_INT_RGB);
+ //Graphics2D g2D = fontImage.createGraphics();
+ Graphics2D g2D = pageSpread.createGraphics();
FontRenderContext frc = g2D.getFontRenderContext();
}