Example usage for java.awt RenderingHints KEY_RENDERING

List of usage examples for java.awt RenderingHints KEY_RENDERING

Introduction

In this page you can find the example usage for java.awt RenderingHints KEY_RENDERING.

Prototype

Key KEY_RENDERING

To view the source code for java.awt RenderingHints KEY_RENDERING.

Click Source Link

Document

Rendering hint key.

Usage

From source file:org.forester.archaeopteryx.TreePanel.java

final void setTextAntialias() {
    if ((_phylogeny != null) && !_phylogeny.isEmpty()) {
        if (_phylogeny.getNumberOfExternalNodes() <= LIMIT_FOR_HQ_RENDERING) {
            _rendering_hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        } else {/*from  ww  w . j a  v a 2s.c  o m*/
            _rendering_hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
        }
    }
    if (getMainPanel().getOptions().isAntialiasScreen()) {
        if (getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR) {
            _rendering_hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
        } else {
            _rendering_hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        }
        try {
            _rendering_hints.put(RenderingHints.KEY_TEXT_ANTIALIASING,
                    RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
        } catch (final Throwable e) {
            _rendering_hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        }
    } else {
        _rendering_hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
        _rendering_hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    }
}