Java Code Examples for java.awt.print.PrinterGraphics

The following are top voted examples for showing how to use java.awt.print.PrinterGraphics. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 2
Project: jdk8u-jdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 3
Project: openjdk-jdk10   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 4
Project: openjdk9   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 5
Project: Java8CN   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 6
Project: jdk8u_jdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 7
Project: lookaside_java-1.8.0-openjdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 8
Project: seaglass   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    // don't render if the width/height are too small
    if (w <= 0 || h <= 0)
        return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);

    ctx = getPaintContext();
    CacheMode cacheMode = ctx == null ? CacheMode.NO_CACHING : ctx.getCacheMode();

    if (cacheMode == CacheMode.NO_CACHING || !ImageCache.getInstance().isImageCachable(w, h) || g instanceof PrinterGraphics) {
        paintDirectly(g, c, w, h, extendedCacheKeys);
    } else {
        paintWithCaching(g, c, w, h, extendedCacheKeys);
    }
}
 
Example 9
Project: infobip-open-jdk-8   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 10
Project: jdk8u-dev-jdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 11
Project: jdk7-jdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 12
Project: openjdk-source-code-learn   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 13
Project: OLD-OpenJDK8   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 14
Project: r2cat   File: PixelGraphics2D.java   Source Code and License 6 votes vote down vote up
protected void setHostGraphics(Graphics graphics) {
    hostGraphics = (Graphics2D) graphics;
    resolution = (graphics instanceof PrinterGraphics) ? 0 : 1;
    tagHandler = new GenericTagHandler(hostGraphics);

    super.setBackground(hostGraphics.getBackground());
    super.setColor(hostGraphics.getColor());
    super.setPaint(hostGraphics.getPaint());
    super.setFont(hostGraphics.getFont());

    Stroke s = hostGraphics.getStroke();
    if (s instanceof BasicStroke) {
        lineWidth = ((BasicStroke) s).getLineWidth();
    }
    webColor = WebColor.create(getColor());
    setRenderingHint(KEY_SYMBOL_BLIT, VALUE_SYMBOL_BLIT_ON);
}
 
Example 15
Project: openjdk-jdk7u-jdk   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 16
Project: openjdk-icedtea7   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;

    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 17
Project: JRLib   File: AbstractRegionPainter.java   Source Code and License 6 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public final void paint(Graphics2D g, JComponent c, int w, int h) {
    //don't render if the width/height are too small
    if (w <= 0 || h <=0) return;
    
    Object[] extendedCacheKeys = getExtendedCacheKeys(c);
    ctx = getPaintContext();
    PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
    if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
            !ImageCache.getInstance().isImageCachable(w, h) ||
            g instanceof PrinterGraphics) {
        // no caching so paint directly
        paint0(g, c, w, h, extendedCacheKeys);
    } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
        paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
    } else {
        // 9 Square caching
        paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
    }
}
 
Example 18
Project: OpenJSharp   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 19
Project: jdk8u-jdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 20
Project: openjdk-jdk10   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 21
Project: openjdk9   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 22
Project: jdk8u_jdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 23
Project: lookaside_java-1.8.0-openjdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 24
Project: LGoodDatePicker   File: RenderingUtils.java   Source Code and License 4 votes vote down vote up
private static boolean isPrinting(Graphics g) {
    return g instanceof PrintGraphics || g instanceof PrinterGraphics;
}
 
Example 25
Project: JCheckboxTree   File: RenderingUtils.java   Source Code and License 4 votes vote down vote up
private static boolean isPrinting(Graphics g) {
    return g instanceof PrintGraphics || g instanceof PrinterGraphics;
}
 
Example 26
Project: confluence.keygen   File: RenderingUtils.java   Source Code and License 4 votes vote down vote up
private static boolean isPrinting(Graphics g)
/* 113:    */   {
/* 114:190 */     return ((g instanceof PrintGraphics)) || ((g instanceof PrinterGraphics));
/* 115:    */   }
 
Example 27
Project: infobip-open-jdk-8   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 28
Project: jdk8u-dev-jdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 29
Project: jdk7-jdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 30
Project: openjdk-source-code-learn   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 31
Project: OLD-OpenJDK8   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 32
Project: r2cat   File: BufferedPanel.java   Source Code and License 4 votes vote down vote up
/**
 * Paint this panel by calling paintComponent(VectorGraphics) if necessary
 * and flushing the buffered image to the screen. This method also handles
 * printing and exporting separately.
 * 
 * @param g Graphics object
 */
public void paintComponent(Graphics g) {
    super.paintComponent(g);

    // do not paint if params are null
    if ((g == null) || (offScreenImage == null))
        return;

    // decide where we are painting
    if (g instanceof PrinterGraphics)
        printing = true;
    if (g instanceof VectorGraphics)
        exporting = true;

    if (!isDisplaying()) {
        paintComponent(VectorGraphics.create(g));
        return;
    }

    if (shouldRepaint()) {
        paintComponent(offScreenGraphics);
    }

    // copy buffer to screen
    //long t0 = System.currentTimeMillis();
    
    /*
     * FREEHEP-503 Disabled, since in Linux this made the blitting very
     * slow.
     * 
     * Despite what the API documentation says, getClipBounds()
     * returns the current dirty region. This can then be used to speedup
     * the drawing of the BufferedPanel.
     */ 
     
    // clip = g.getClipBounds(clip);
    // Make sure the clip is not larger than the bounds. 
    // clip = clip.intersection(getBounds());
    // BufferedImage bufferedImage = (BufferedImage)offScreenImage;
    // BufferedImage subimage = bufferedImage.getSubimage(clip.x,clip.y,
    // clip.width,clip.height); boolean done =
    // g.drawImage(subimage,clip.x,clip.y,this);


    /* boolean done = */ g.drawImage(offScreenImage, 0, 0, this);
    // System.err.println("CopyImage "+done+" took:
    // "+(System.currentTimeMillis()-t0)+" ms.");
}
 
Example 33
Project: openjdk-jdk7u-jdk   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}
 
Example 34
Project: IBMDataMovementTool   File: RenderingUtils.java   Source Code and License 4 votes vote down vote up
private static boolean isPrinting(Graphics g)
{
  return ((g instanceof PrintGraphics)) || ((g instanceof PrinterGraphics));
}
 
Example 35
Project: IBMDataMovementTool   File: RenderingUtils.java   Source Code and License 4 votes vote down vote up
private static boolean isPrinting(Graphics g) {
    return g instanceof PrintGraphics || g instanceof PrinterGraphics;
}
 
Example 36
Project: openjdk-icedtea7   File: SwingUtilities2.java   Source Code and License 4 votes vote down vote up
static boolean isPrinting(Graphics g) {
    return (g instanceof PrinterGraphics || g instanceof PrintGraphics);
}