/** * Constructor for the Context object */ public SharedContext(UserAgentCallback uac, FontResolver fr, ReplacedElementFactory ref, TextRenderer tr, float dpi) { font_resolver = fr; replacedElementFactory = ref; setMedia("screen"); this.uac = uac; setCss(new StyleReference(uac)); XRLog.render("Using CSS implementation from: " + getCss().getClass().getName()); setTextRenderer(tr); setDPI(dpi); }
/** * Constructor for the Context object */ public SharedContext(UserAgentCallback uac) { font_resolver = new AWTFontResolver(); replacedElementFactory = new SwingReplacedElementFactory(); setMedia("screen"); this.uac = uac; setCss(new StyleReference(uac)); XRLog.render("Using CSS implementation from: " + getCss().getClass().getName()); setTextRenderer(new Java2DTextRenderer()); try { setDPI(Toolkit.getDefaultToolkit().getScreenResolution()); } catch (HeadlessException e) { setDPI(DEFAULT_DPI); } }
/** * Constructor for the Context object */ public SharedContext(UserAgentCallback uac) { font_resolver = new AWTFontResolver(); replacedElementFactory = new SwingReplacedElementFactory(); setMedia("screen"); this.uac = uac; setCss(new StyleReference(uac)); XRLog.render("Using CSS implementation from: " + getCss().getClass().getName()); setTextRenderer(new Java2DTextRenderer()); try { setDPI(Toolkit.getDefaultToolkit().getScreenResolution()); } catch (HeadlessException e) { setDPI(DEFAULT_DPI); } } public void setFormSubmissionListener(FormSubmissionListener fsl) {
private SharedContext newSharedContext(int dotsPerPixel, UserAgentCallback userAgent) { SharedContext context = new SharedContext(userAgent); AWTFontResolver fontResolver = new AWTFontResolver(); context.setFontResolver(fontResolver); SwingReplacedElementFactory replacedElementFactory = new SwingReplacedElementFactory(); context.setReplacedElementFactory(replacedElementFactory); context.setTextRenderer(new Java2DTextRenderer()); context.setDPI(72 * this.dotsPerPoint); context.setDotsPerPixel(dotsPerPixel); context.setPrint(false); context.setInteractive(false); return context; }
private SharedContext newSharedContext(int dotsPerPixel, UserAgentCallback userAgent) { SharedContext context = new SharedContext(userAgent); AWTFontResolver fontResolver = new AWTFontResolver(); context.setFontResolver(fontResolver); SwingReplacedElementFactory replacedElementFactory = new SwingReplacedElementFactory(); context.setReplacedElementFactory(replacedElementFactory); context.setTextRenderer(new Java2DTextRenderer()); context.setDPI(72 * this.dotsPerPoint); context.setDotsPerPixel(dotsPerPixel); context.setPrint(false); context.setInteractive(false); return context; }
private void init(float dotsPerPoint, int dotsPerPixel) { this.dotsPerPoint = dotsPerPoint; outputImage = ImageUtil.createCompatibleBufferedImage(DEFAULT_DOTS_PER_POINT, DEFAULT_DOTS_PER_POINT); outputDevice = new Java2DOutputDevice(outputImage); UserAgentCallback userAgent = new NaiveUserAgent(); sharedContext = new SharedContext(userAgent); AWTFontResolver fontResolver = new AWTFontResolver(); sharedContext.setFontResolver(fontResolver); SwingReplacedElementFactory replacedElementFactory = new SwingReplacedElementFactory(); sharedContext.setReplacedElementFactory(replacedElementFactory); sharedContext.setTextRenderer(new Java2DTextRenderer()); sharedContext.setDPI(72 * this.dotsPerPoint); sharedContext.setDotsPerPixel(dotsPerPixel); sharedContext.setPrint(false); sharedContext.setInteractive(false); }
private void init(float dotsPerPoint, int dotsPerPixel) { this.dotsPerPoint = dotsPerPoint; outputImage = ImageUtil.createCompatibleBufferedImage(DEFAULT_DOTS_PER_POINT, DEFAULT_DOTS_PER_POINT); outputDevice = new Java2DOutputDevice(outputImage); UserAgentCallback userAgent = new NaiveUserAgent(); sharedContext = new SharedContext(userAgent); AWTFontResolver fontResolver = new AWTFontResolver(); sharedContext.setFontResolver(fontResolver); SwingReplacedElementFactory replacedElementFactory = new SwingReplacedElementFactory(); sharedContext.setReplacedElementFactory(replacedElementFactory); sharedContext.setTextRenderer(new Java2DTextRenderer()); sharedContext.setDPI(72 * this.dotsPerPoint); sharedContext.setDotsPerPixel(dotsPerPixel); sharedContext.setPrint(false); sharedContext.setInteractive(false); }
public ITextRenderer(float dotsPerPoint, int dotsPerPixel) { _dotsPerPoint = dotsPerPoint; _outputDevice = new ITextOutputDevice(_dotsPerPoint); ITextUserAgent userAgent = new ITextUserAgent(_outputDevice); _sharedContext = new SharedContext(userAgent); userAgent.setSharedContext(_sharedContext); _outputDevice.setSharedContext(_sharedContext); ITextFontResolver fontResolver = new ITextFontResolver(_sharedContext); _sharedContext.setFontResolver(fontResolver); ITextReplacedElementFactory replacedElementFactory = new ITextReplacedElementFactory(_outputDevice); _sharedContext.setReplacedElementFactory(replacedElementFactory); _sharedContext.setTextRenderer(new ITextTextRenderer()); _sharedContext.setDPI(72*_dotsPerPoint); _sharedContext.setDotsPerPixel(dotsPerPixel); _sharedContext.setPrint(true); _sharedContext.setInteractive(false); }
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent) { _dotsPerPoint = dotsPerPoint; _outputDevice = outputDevice; _sharedContext = new SharedContext(); _sharedContext.setUserAgentCallback(userAgent); _sharedContext.setCss(new StyleReference(userAgent)); userAgent.setSharedContext(_sharedContext); _outputDevice.setSharedContext(_sharedContext); ITextFontResolver fontResolver = new ITextFontResolver(_sharedContext); _sharedContext.setFontResolver(fontResolver); ITextReplacedElementFactory replacedElementFactory = new ITextReplacedElementFactory(_outputDevice); _sharedContext.setReplacedElementFactory(replacedElementFactory); _sharedContext.setTextRenderer(new ITextTextRenderer()); _sharedContext.setDPI(72 * _dotsPerPoint); _sharedContext.setDotsPerPixel(dotsPerPixel); _sharedContext.setPrint(true); _sharedContext.setInteractive(false); _timeouted= false; }
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent) { _dotsPerPoint = dotsPerPoint; _outputDevice = outputDevice; _sharedContext = new SharedContext(); _sharedContext.setUserAgentCallback(userAgent); _sharedContext.setCss(new StyleReference(userAgent)); userAgent.setSharedContext(_sharedContext); _outputDevice.setSharedContext(_sharedContext); ITextFontResolver fontResolver = new ITextFontResolver(_sharedContext); _sharedContext.setFontResolver(fontResolver); ITextReplacedElementFactory replacedElementFactory = new ITextReplacedElementFactory(_outputDevice); _sharedContext.setReplacedElementFactory(replacedElementFactory); _sharedContext.setTextRenderer(new ITextTextRenderer()); _sharedContext.setDPI(72 * _dotsPerPoint); _sharedContext.setDotsPerPixel(dotsPerPixel); _sharedContext.setPrint(true); _sharedContext.setInteractive(false); _timeouted= false; }
public ITextRenderer(float dotsPerPoint, int dotsPerPixel) { _dotsPerPoint = dotsPerPoint; _outputDevice = new ITextOutputDevice(_dotsPerPoint); ITextUserAgent userAgent = new ITextUserAgent(_outputDevice); _sharedContext = new SharedContext(); _sharedContext.setUserAgentCallback(userAgent); _sharedContext.setCss(new StyleReference(userAgent)); userAgent.setSharedContext(_sharedContext); _outputDevice.setSharedContext(_sharedContext); ITextFontResolver fontResolver = new ITextFontResolver(_sharedContext); _sharedContext.setFontResolver(fontResolver); ITextReplacedElementFactory replacedElementFactory = new ITextReplacedElementFactory(_outputDevice); _sharedContext.setReplacedElementFactory(replacedElementFactory); _sharedContext.setTextRenderer(new ITextTextRenderer()); _sharedContext.setDPI(72*_dotsPerPoint); _sharedContext.setDotsPerPixel(dotsPerPixel); _sharedContext.setPrint(true); _sharedContext.setInteractive(false); }
public ITextRenderer(float dotsPerPoint, int dotsPerPixel) { _dotsPerPoint = dotsPerPoint; _outputDevice = new ITextOutputDevice(_dotsPerPoint); ITextUserAgent userAgent = new ITextUserAgent(_outputDevice); _sharedContext = new SharedContext(); _sharedContext.setUserAgentCallback(userAgent); _sharedContext.setCss(new StyleReference(userAgent)); userAgent.setSharedContext(_sharedContext); _outputDevice.setSharedContext(_sharedContext); ITextFontResolver fontResolver = new ITextFontResolver(_sharedContext); _sharedContext.setFontResolver(fontResolver); ITextReplacedElementFactory replacedElementFactory = new ITextReplacedElementFactory(_outputDevice); _sharedContext.setReplacedElementFactory(replacedElementFactory); _sharedContext.setTextRenderer(new ITextTextRenderer()); _sharedContext.setDPI(72 * _dotsPerPoint); _sharedContext.setDotsPerPixel(dotsPerPixel); _sharedContext.setPrint(true); _sharedContext.setInteractive(false); }
g2r.getSharedContext().setPrint(true); g2r.getSharedContext().setInteractive(false); g2r.getSharedContext().setDPI(72f); g2r.getSharedContext().getTextRenderer().setSmoothingThreshold(0); g2r.getSharedContext().setUserAgentCallback(panel.getSharedContext().getUserAgentCallback());
g2r.getSharedContext().setPrint(true); g2r.getSharedContext().setInteractive(false); g2r.getSharedContext().setDPI(72f); g2r.getSharedContext().getTextRenderer().setSmoothingThreshold(0); g2r.getSharedContext().setUserAgentCallback(panel.getSharedContext().getUserAgentCallback());