Package javax.swing

Examples of javax.swing.RepaintManager$DisplayChangedHandler


            response = Printable.PAGE_EXISTS;
        }
        return response;
    }
    public static void disableDoubleBuffering(Component c) {
        RepaintManager currentManager = RepaintManager.currentManager(c);
        currentManager.setDoubleBufferingEnabled(false);
    }
View Full Code Here


    public static void disableDoubleBuffering(Component c) {
        RepaintManager currentManager = RepaintManager.currentManager(c);
        currentManager.setDoubleBufferingEnabled(false);
    }
    public static void enableDoubleBuffering(Component c) {
        RepaintManager currentManager = RepaintManager.currentManager(c);
        currentManager.setDoubleBufferingEnabled(true);
    }
View Full Code Here

    public int print(Graphics pg, PageFormat pageFormat, int pageIndex)
    {
        if (pageIndex == 0)
        {
            pg.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY());
            RepaintManager currentManager = RepaintManager.currentManager(this);
            currentManager.setDoubleBufferingEnabled(false);
            Graphics2D g2d = (Graphics2D)pg;
            g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
            g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
            doPaint(pg, new Dimension((int)pageFormat.getImageableWidth(), (int)pageFormat.getImageableHeight()), true);
            currentManager.setDoubleBufferingEnabled(true);
            System.gc();
            return PAGE_EXISTS;
        }
        else return NO_SUCH_PAGE;
    }
View Full Code Here

    public int print(Graphics pg, PageFormat pageFormat, int pageIndex)
    {
        if (m_img != null && pageIndex == 0)
        {
            pg.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY());
            RepaintManager currentManager = RepaintManager.currentManager(this);
            currentManager.setDoubleBufferingEnabled(false);
            Graphics2D g2d = (Graphics2D)pg;
            g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
            g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
            doPaint(pg, new Dimension((int)pageFormat.getImageableWidth(), (int)pageFormat.getImageableHeight()), true);
            currentManager.setDoubleBufferingEnabled(true);
            System.gc();
            return PAGE_EXISTS;
        }
        return NO_SUCH_PAGE;
    }
View Full Code Here

    protected void onInitialize() {
        log.debug("onInitialize");

        // Set the repaint manager

        RepaintManager.setCurrentManager(repaintManager = new RepaintManager() {
            private WeakHashMap<Component, BufferedImage> bufferMap = new WeakHashMap<Component, BufferedImage>();
            @SuppressWarnings("unused")
            private final Component DEFA_KEY = new Component() {
                private static final long serialVersionUID = 1L;
            };
View Full Code Here

    JLabel l = new JLabel("Hello");
    f.getContentPane().add(l);
    l.setSize(100, 100);
    f.setSize(200, 200);
    f.setVisible(true);
    RepaintManager rm = RepaintManager.currentManager(l);
    rm.addDirtyRegion(l, 0, 0, l.getWidth(), l.getHeight());
    harness.check(rm.isCompletelyDirty(l), false);
    Rectangle dirty = rm.getDirtyRegion(l);
    harness.check(dirty.x, 0);
    harness.check(dirty.y, 0);
    harness.check(dirty.width, l.getWidth());
    harness.check(dirty.height, l.getHeight());
  }
View Full Code Here

     *            the current repaint manager
     * @return a non-{@code null} {@code TranslucentRepaintManager}
     * @throws NullPointerException if {@code delegate} is {@code null}
     */
    static RepaintManager getTranslucentRepaintManager(RepaintManager delegate) {
        RepaintManager manager = delegate;
       
        while (manager != null && !manager.getClass().isAnnotationPresent(TranslucentRepaintManager.class)) {
            if (manager instanceof ForwardingRepaintManager) {
                manager = ((ForwardingRepaintManager) manager).getDelegateManager();
            } else {
                manager = null;
            }
View Full Code Here

    else
    {
      Graphics2D g2d = (Graphics2D) g;
      g2d.translate( pageFormat.getImageableX (), pageFormat.getImageableY () );

            RepaintManager currentManager = RepaintManager.currentManager( this);
      currentManager.setDoubleBufferingEnabled( false );

      paint( g2d );

      currentManager.setDoubleBufferingEnabled( true );

      return PAGE_EXISTS;
    }
  }
View Full Code Here

    else
    {
      Graphics2D g2d = (Graphics2D) g;
      g2d.translate( pageFormat.getImageableX (), pageFormat.getImageableY () );

            RepaintManager currentManager = RepaintManager.currentManager( this);
      currentManager.setDoubleBufferingEnabled( false );

      dataPanel.paint( g2d );

      currentManager.setDoubleBufferingEnabled( true );

      return PAGE_EXISTS;
    }
  }
View Full Code Here

    /**
     * Returns delegate {@code RepaintManager} for {@code component} hierarchy.
     */
    public static RepaintManager getDelegateRepaintManager(Component
                                                            component) {
        RepaintManager delegate = null;
        if (Boolean.TRUE == AppContext.getAppContext().get(
                                               DELEGATE_REPAINT_MANAGER_KEY)) {
            while (delegate == null && component != null) {
                while (component != null
                         && ! (component instanceof JComponent)) {
View Full Code Here

TOP

Related Classes of javax.swing.RepaintManager$DisplayChangedHandler

Copyright © 2018 www.massapicom. 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.