*/
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();
}
*/
package org.apache.fop.fo;
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.font.FontRenderContext;
import java.util.logging.Level;
import java.util.logging.Logger;
PropertyConsts.pconsts.getInitialValue(PropNames.FONT_SIZE);
if ( ! (prop instanceof Numeric) || ! ((Numeric)prop).isLength())
throw new PropertyException("Initial font-size is not a Length");
+ // Set up the rendering context
+ }
-
- /*
- for (int i = 1; i <= PropNames.LAST_PROPERTY_INDEX; i++) {
- if (i == PropNames.FONT_SIZE) continue;
- // Set up the initial values for each property
- PropertyConsts.pconsts.getInitialValue(i);
- //System.out.println("....Setting initial value for " + i);
- }
- */
-
+ /** The graphics environment in which FOP is operating */
+ private GraphicsEnvironment gEnv = null;
+ /**
+ * Gets the FOP <code>GraphicsEnvironment</code>
+ * @return the environment
+ */
+ protected GraphicsEnvironment getGraphicsEnvironment() {
+ return gEnv;
+ }
+ /** The object which controls drawing and text rendering in the page spread
+ */
+ private Graphics2D g2D = null;
+ /**
+ * Gets the <code>Graphics2D</code> rendering and drawing control object
+ * for area layout
+ * @return
+ */
+ public Graphics2D getGraphics2D() {
+ return g2D;
+ }
+ /** The <code>FontRenderContext</code> object garnered from the
+ * <code>Graphics2D</code> control object for area layout
+ */
+ private FontRenderContext frcontext = null;
+ /**
+ * Gets the <code>FontRenderContext</code> derived from the graphics
+ * control object
+ * @return
+ */
+ public FontRenderContext getFontRenderContext() {
+ return frcontext;
}
/**
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;
}
return (Page)firstPage;
}
+
+ /** An image on which to draw areas */
+ private BufferedImage pageSpread = null;
+ /**
+ * Gets the page spread image from which the <code>Graphics2D</code> and
+ * <code>FontRenderContext</code> have been derived.
+ * @return the page spread
+ */
+ public BufferedImage getPageSpread() {
+ return pageSpread;
+ }
+
/**
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
// 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
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
// parent block area.
// Generate a text-layout for the PCDATA.
/**
- * Generate a
+ * Generates a TextMeasurer from the PCDATA text. The font and text
+ * attributes of the text are applied.
*/
private void processText() {
-
+ // Get the font
+ //
}
}