本文整理汇总了Java中sun.java2d.pipe.TextPipe类的典型用法代码示例。如果您正苦于以下问题:Java TextPipe类的具体用法?Java TextPipe怎么用?Java TextPipe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextPipe类属于sun.java2d.pipe包,在下文中一共展示了TextPipe类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTextPipe
import sun.java2d.pipe.TextPipe; //导入依赖的package包/类
private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn) {
/* Try to avoid calling getFontInfo() unless its needed to
* resolve one of the new AA types.
*/
switch (sg2d.textAntialiasHint) {
case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
if (aaHintIsOn) {
return aaTextRenderer;
} else {
return solidTextRenderer;
}
case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
return solidTextRenderer;
case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
return aaTextRenderer;
default:
switch (sg2d.getFontInfo().aaHint) {
case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB:
return lcdTextRenderer;
case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
return aaTextRenderer;
case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
return solidTextRenderer;
/* This should not be reached as the FontInfo will
* always explicitly set its hint value. So whilst
* this could be collapsed to returning say just
* solidTextRenderer, or even removed, its left
* here in case DEFAULT is ever passed in.
*/
default:
if (aaHintIsOn) {
return aaTextRenderer;
} else {
return solidTextRenderer;
}
}
}
}