Examples of SharedContext


Examples of org.apache.wookie.beans.SharedContext

    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2");
    if(ContextListener.useSharedDataInstanceQueues){// 
      QueueManager.getInstance().queueSetSharedDataRequest(id_key, SharedDataHelper.getInternalSharedDataKey(widgetInstance), key, value, false);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, false);
    }
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2");
    if(ContextListener.useSharedDataInstanceQueues){//
      QueueManager.getInstance().queueSetSharedDataRequest(id_key, SharedDataHelper.getInternalSharedDataKey(widgetInstance), key, value, true);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, true);
    }
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

    public BasicPanel() {
        this(new NaiveUserAgent());
    }

    public BasicPanel(UserAgentCallback uac) {
        sharedContext = new SharedContext(uac);
        mouseTracker = new MouseTracker(this);

        init();
    }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

        sharedContext = newSharedContext(dotsPerPixel, userAgent);
        layoutContext = newLayoutContext();
  }

    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;
    }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

    /**
     * Resets all rendered fonts on the current document to the font size
     * specified in the document's styling instructions.
     */
    public void resetFontSize() {
        SharedContext rc = getSharedContext();
        rc.getTextRenderer().setFontScale(1.0F);
        setDocument(getDocument());
    }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

    /**
     * Applies a change in scale for fonts using the rendering context's text
     * renderer.
     */
    private void scaleFont(float scaleBy) {
        SharedContext rc = getSharedContext();
        float fs = rc.getTextRenderer().getFontScale() * scaleBy;
        if (fs < minFontScale || fs > maxFontScale) return;
        rc.getTextRenderer().setFontScale(fs);
        setDocument(getDocument());
    }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

        _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);
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

        try {
            if (j2dr == null) {

                j2dr = new Java2DRenderer(file, 1024);
                SharedContext context = j2dr.getSharedContext();
                context.setPrint(true);
                context.setInteractive(false);
                context.setDPI(72f);

                context.getTextRenderer().setSmoothingThreshold(0);

            }

            return Printable.PAGE_EXISTS;
        } catch (Exception ex) {
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

        aboutDlg.setVisible(true);
    }

    private void togglePrintPreview() {
        try {
            SharedContext sharedContext = root.panel.view.getSharedContext();

            // flip status--either we are in "print" mode (print media) or non-print (screen media)
            if (sharedContext.isPrint()) {
                sharedContext.setPrint(false);
                sharedContext.setInteractive(true);
            } else {
                sharedContext.setPrint(true);
                sharedContext.setInteractive(false);
            }
            print_preview.putValue(Action.SHORT_DESCRIPTION,
                    ! sharedContext.isPrint() ? "Print preview" : "Normal view");
            root.panel.reloadPage();
            root.panel.view.repaint();
        } catch (Exception ex) {
            Uu.p(ex);
        }
View Full Code Here

Examples of org.xhtmlrenderer.layout.SharedContext

    // toolbar.add(print);
        toolbar.setFloatable(false);
    }

  private void loadCustomFonts() {
    SharedContext rc = view.getSharedContext();
    try {
      rc.setFontMapping("Fuzz", Font.createFont(Font.TRUETYPE_FONT,
          new DemoMarker().getClass().getResourceAsStream("/demos/fonts/fuzz.ttf")));
    } catch (Exception ex) {
      Uu.p(ex);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.