本文整理汇总了Java中java.awt.RenderingHints.VALUE_ANTIALIAS_DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java RenderingHints.VALUE_ANTIALIAS_DEFAULT属性的具体用法?Java RenderingHints.VALUE_ANTIALIAS_DEFAULT怎么用?Java RenderingHints.VALUE_ANTIALIAS_DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.RenderingHints
的用法示例。
在下文中一共展示了RenderingHints.VALUE_ANTIALIAS_DEFAULT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAntiAlias
/**
* 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();
}
示例2: setAntiAlias
/**
* 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();
}