public interface Paint extends Transparency
Paint接口定义如何为Graphics2D操作生成颜色模式。
实施A类Paint接口被添加到Graphics2D上下文,以限定由所使用的彩色图案draw种fill方法。
在实施的类的实例Paint必须只读因为Graphics2D当它们被设置为与所述一个属性并不克隆这些对象setPaint方法或当Graphics2D对象本身进行克隆。
PaintContext , Color , GradientPaint , TexturePaint , Graphics2D.setPaint(java.awt.Paint)
BITMASK, OPAQUE, TRANSLUCENT| Modifier and Type | Method and Description |
|---|---|
PaintContext |
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
创建并返回一个用于生成颜色模式的 PaintContext 。
|
getTransparencyPaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
PaintContext 。
该方法的参数传达关于Paint接口的各种实现可能使用或忽略的Paint附加信息。
呼叫者必须传递所有参数的非null值,不包括可能为null的ColorModel参数,以表示不使用特定的ColorModel类型。
的的实现Paint接口被允许使用或忽略任何的参数作为它们的功能是有意义的,并且不限制使用指定的ColorModel为返回PaintContext ,即使它不是null 。
实现允许抛出NullPointerException任何null比其他参数ColorModel说法,但这样做不是必需的。
cm -优选ColorModel表示用于呼叫者接收的像素数据,或最方便的格式null如果没有偏好。
deviceBounds - 正在呈现的图形基元的设备空间边界框。
的的实现Paint接口都允许抛出NullPointerException为null deviceBounds 。
userBounds - 正在呈现的图形基元的用户空间边界框。
的的实现Paint接口都允许抛出NullPointerException为null userBounds 。
xform - 从用户空间到设备空间的AffineTransform 。
的的实现Paint接口都允许抛出NullPointerException为null xform 。
hints - 上下文对象可用于在渲染替代方案之间进行选择的一组提示。
的的实现Paint接口都允许抛出NullPointerException为null hints 。
PaintContext 。
PaintContext , ColorModel , Rectangle , Rectangle2D , AffineTransform , RenderingHints
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.