Java Code Examples for java.awt.RenderingHints.VALUE_ANTIALIAS_DEFAULT

The following are Jave code examples for showing how to use VALUE_ANTIALIAS_DEFAULT of the java.awt.RenderingHints class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: parabuild-ci   File: JFreeChart.java   Source Code and License Vote up 6 votes
/**
 * Sets a flag that indicates whether or not anti-aliasing is used when the
 * chart is drawn.
 * <P>
 * Anti-aliasing usually improves the appearance of charts, but is slower.
 *
 * @param flag  the new value of the flag.
 */
public void setAntiAlias(boolean flag) {

    Object o = this.renderingHints.get(RenderingHints.KEY_ANTIALIASING);
    if (o == null) {
        o = RenderingHints.VALUE_ANTIALIAS_DEFAULT;
    }
    if (!flag && RenderingHints.VALUE_ANTIALIAS_OFF.equals(o) 
        || flag && RenderingHints.VALUE_ANTIALIAS_ON.equals(o)) {
        // no change, do nothing
        return;
    }
    if (flag) {
        this.renderingHints.put(RenderingHints.KEY_ANTIALIASING, 
                                RenderingHints.VALUE_ANTIALIAS_ON);
    }
    else {
        this.renderingHints.put(RenderingHints.KEY_ANTIALIASING, 
                                RenderingHints.VALUE_ANTIALIAS_OFF);
    }
    fireChartChanged();

}
 
Example 2
Project: parabuild-ci   File: JFreeChart.java   Source Code and License Vote up 6 votes
/**
 * Sets a flag that indicates whether or not anti-aliasing is used when the
 * chart is drawn.
 * <P>
 * Anti-aliasing usually improves the appearance of charts, but is slower.
 *
 * @param flag  the new value of the flag.
 * 
 * @see #getAntiAlias()
 */
public void setAntiAlias(boolean flag) {

    Object val = this.renderingHints.get(RenderingHints.KEY_ANTIALIASING);
    if (val == null) {
        val = RenderingHints.VALUE_ANTIALIAS_DEFAULT;
    }
    if (!flag && RenderingHints.VALUE_ANTIALIAS_OFF.equals(val) 
        || flag && RenderingHints.VALUE_ANTIALIAS_ON.equals(val)) {
        // no change, do nothing
        return;
    }
    if (flag) {
        this.renderingHints.put(RenderingHints.KEY_ANTIALIASING, 
                                RenderingHints.VALUE_ANTIALIAS_ON);
    }
    else {
        this.renderingHints.put(RenderingHints.KEY_ANTIALIASING, 
                                RenderingHints.VALUE_ANTIALIAS_OFF);
    }
    fireChartChanged();

}