本文整理汇总了Java中sun.java2d.loops.SurfaceType.AnyPaint方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceType.AnyPaint方法的具体用法?Java SurfaceType.AnyPaint怎么用?Java SurfaceType.AnyPaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.java2d.loops.SurfaceType
的用法示例。
在下文中一共展示了SurfaceType.AnyPaint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaintSurfaceType
import sun.java2d.loops.SurfaceType; //导入方法依赖的package包/类
private static SurfaceType getPaintSurfaceType(SunGraphics2D sg2d) {
switch (sg2d.paintState) {
case SunGraphics2D.PAINT_OPAQUECOLOR:
return SurfaceType.OpaqueColor;
case SunGraphics2D.PAINT_ALPHACOLOR:
return SurfaceType.AnyColor;
case SunGraphics2D.PAINT_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueGradientPaint;
} else {
return SurfaceType.GradientPaint;
}
case SunGraphics2D.PAINT_LIN_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueLinearGradientPaint;
} else {
return SurfaceType.LinearGradientPaint;
}
case SunGraphics2D.PAINT_RAD_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueRadialGradientPaint;
} else {
return SurfaceType.RadialGradientPaint;
}
case SunGraphics2D.PAINT_TEXTURE:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueTexturePaint;
} else {
return SurfaceType.TexturePaint;
}
default:
case SunGraphics2D.PAINT_CUSTOM:
return SurfaceType.AnyPaint;
}
}