class WCGraphicsPrismContext extends WCGraphicsContext
Modifier and Type | Class and Description |
---|---|
private static class |
WCGraphicsPrismContext.ClipLayer |
private class |
WCGraphicsPrismContext.Composite |
private static class |
WCGraphicsPrismContext.ContextState |
private static class |
WCGraphicsPrismContext.Layer |
private static class |
WCGraphicsPrismContext.PassThrough |
private class |
WCGraphicsPrismContext.TransparencyLayer |
static class |
WCGraphicsPrismContext.Type |
Modifier and Type | Field and Description |
---|---|
(package private) Graphics |
baseGraphics |
private BaseTransform |
baseTransform |
private Graphics |
cachedGraphics |
private static boolean |
DEBUG_DRAW_CLIP_SHAPE |
private static BasicStroke |
focusRingStroke |
private int |
fontSmoothingType |
private boolean |
isRootLayerValid |
private static java.util.logging.Logger |
log |
private WCGraphicsPrismContext.ContextState |
state |
private java.util.List<WCGraphicsPrismContext.ContextState> |
states |
COMPOSITE_CLEAR, COMPOSITE_COPY, COMPOSITE_DESTINATION_ATOP, COMPOSITE_DESTINATION_IN, COMPOSITE_DESTINATION_OUT, COMPOSITE_DESTINATION_OVER, COMPOSITE_HIGHLIGHT, COMPOSITE_PLUS_DARKER, COMPOSITE_PLUS_LIGHTER, COMPOSITE_SOURCE_ATOP, COMPOSITE_SOURCE_IN, COMPOSITE_SOURCE_OUT, COMPOSITE_SOURCE_OVER, COMPOSITE_XOR
Constructor and Description |
---|
WCGraphicsPrismContext() |
WCGraphicsPrismContext(Graphics g) |
Modifier and Type | Method and Description |
---|---|
void |
beginTransparencyLayer(float opacity) |
void |
clearRect(float x,
float y,
float w,
float h) |
void |
concatTransform(WCTransform tm) |
(package private) static Color |
createColor(int rgba) |
private static Color4f |
createColor4f(int rgba) |
WCGradient |
createLinearGradient(WCPoint p1,
WCPoint p2) |
WCGradient |
createRadialGradient(WCPoint p1,
float r1,
WCPoint p2,
float r2) |
private DropShadow |
createShadow(float dx,
float dy,
float blur,
int rgba) |
void |
dispose() |
void |
drawBitmapImage(java.nio.ByteBuffer image,
int x,
int y,
int w,
int h) |
void |
drawEllipse(int x,
int y,
int w,
int h) |
void |
drawFocusRing(int x,
int y,
int w,
int h,
int rgba) |
void |
drawIcon(WCIcon icon,
int x,
int y) |
void |
drawImage(WCImage img,
float dstx,
float dsty,
float dstw,
float dsth,
float srcx,
float srcy,
float srcw,
float srch) |
void |
drawLine(int x0,
int y0,
int x1,
int y1) |
void |
drawPattern(WCImage texture,
WCRectangle srcRect,
WCTransform patternTransform,
WCPoint phase,
WCRectangle destRect) |
void |
drawPolygon(WCPath path,
boolean shouldAntialias) |
void |
drawRect(int x,
int y,
int w,
int h) |
void |
drawScrollbar(ScrollBarTheme theme,
Ref widget,
int x,
int y,
int pressedPart,
int hoveredPart) |
void |
drawString(WCFont f,
int[] glyphs,
float[] advances,
float x,
float y) |
void |
drawString(WCFont f,
java.lang.String str,
boolean rtl,
int from,
int to,
float x,
float y) |
void |
drawWidget(RenderTheme theme,
Ref widget,
int x,
int y) |
void |
endTransparencyLayer() |
void |
fillPath(WCPath path) |
void |
fillRect(float x,
float y,
float w,
float h,
java.lang.Integer rgba) |
void |
fillRoundedRect(float x,
float y,
float w,
float h,
float topLeftW,
float topLeftH,
float topRightW,
float topRightH,
float bottomLeftW,
float bottomLeftH,
float bottomRightW,
float bottomRightH,
int rgba) |
void |
flush() |
private void |
flushAllLayers()
Renders all layers to the underlaying Graphics, but preserves the
current state and the states stack
|
float |
getAlpha() |
WCRectangle |
getClip() |
protected Rectangle |
getClipRectNoClone() |
private static FilterContext |
getFilterContext(Graphics g) |
int |
getFontSmoothingType() |
(package private) Graphics |
getGraphics(boolean checkClip) |
WCImage |
getImage() |
java.lang.Object |
getPlatformGraphics() |
WCTransform |
getTransform() |
protected Affine3D |
getTransformNoClone() |
(package private) void |
initBaseTransform(BaseTransform t) |
private static Rectangle |
intersect(Rectangle what,
Rectangle with) |
private void |
render(Graphics g,
Effect effect,
Paint paint,
BasicStroke stroke,
NGNode node) |
private void |
renderLayer(WCGraphicsPrismContext.Layer layer) |
private void |
resetCachedGraphics() |
void |
restoreState() |
private void |
restoreStateInternal() |
void |
rotate(float radians) |
void |
saveState() |
private void |
saveStateInternal() |
void |
scale(float sx,
float sy) |
void |
setAlpha(float alpha) |
void |
setClip(int cx,
int cy,
int cw,
int ch) |
private void |
setClip(Rectangle shape) |
void |
setClip(WCPath path,
boolean isOut) |
void |
setClip(WCRectangle c) |
void |
setComposite(int composite) |
void |
setFillColor(int rgba) |
void |
setFillGradient(WCGradient gradient) |
void |
setFontSmoothingType(int fontSmoothingType) |
void |
setLineCap(int lineCap) |
void |
setLineDash(float offset,
float... sizes) |
void |
setLineJoin(int lineJoin) |
void |
setMiterLimit(float miterLimit) |
void |
setPerspectiveTransform(WCTransform tm) |
void |
setShadow(float dx,
float dy,
float blur,
int rgba) |
void |
setStrokeColor(int rgba) |
void |
setStrokeGradient(WCGradient gradient) |
void |
setStrokeStyle(int style) |
void |
setStrokeWidth(float width) |
void |
setTextMode(boolean fill,
boolean stroke,
boolean clip) |
void |
setTransform(WCTransform tm) |
protected boolean |
shouldCalculateIntersection() |
protected boolean |
shouldRenderRect(float x,
float y,
float w,
float h,
DropShadow shadow,
BasicStroke stroke) |
protected boolean |
shouldRenderShape(Shape shape,
DropShadow shadow,
BasicStroke stroke) |
private void |
startNewLayer(WCGraphicsPrismContext.Layer layer) |
void |
strokeArc(int x,
int y,
int w,
int h,
int startAngle,
int angleSpan) |
void |
strokePath(WCPath path) |
void |
strokeRect(float x,
float y,
float w,
float h,
float lineWidth) |
private Rectangle |
transformClip(Rectangle localClip) |
void |
translate(float x,
float y) |
WCGraphicsPrismContext.Type |
type() |
private static final java.util.logging.Logger log
private static final boolean DEBUG_DRAW_CLIP_SHAPE
Graphics baseGraphics
private BaseTransform baseTransform
private final java.util.List<WCGraphicsPrismContext.ContextState> states
private WCGraphicsPrismContext.ContextState state
private Graphics cachedGraphics
private int fontSmoothingType
private boolean isRootLayerValid
private static final BasicStroke focusRingStroke
WCGraphicsPrismContext(Graphics g)
WCGraphicsPrismContext()
public WCGraphicsPrismContext.Type type()
final void initBaseTransform(BaseTransform t)
private void resetCachedGraphics()
public java.lang.Object getPlatformGraphics()
getPlatformGraphics
in class WCGraphicsContext
Graphics getGraphics(boolean checkClip)
public void saveState()
saveState
in class WCGraphicsContext
private void saveStateInternal()
private void startNewLayer(WCGraphicsPrismContext.Layer layer)
private void renderLayer(WCGraphicsPrismContext.Layer layer)
private void restoreStateInternal()
public void restoreState()
restoreState
in class WCGraphicsContext
private void flushAllLayers()
public void dispose()
dispose
in class WCGraphicsContext
public void setClip(WCPath path, boolean isOut)
setClip
in class WCGraphicsContext
private void setClip(Rectangle shape)
public void setClip(int cx, int cy, int cw, int ch)
setClip
in class WCGraphicsContext
public void setClip(WCRectangle c)
setClip
in class WCGraphicsContext
public WCRectangle getClip()
getClip
in class WCGraphicsContext
protected Rectangle getClipRectNoClone()
protected Affine3D getTransformNoClone()
public void translate(float x, float y)
translate
in class WCGraphicsContext
public void scale(float sx, float sy)
scale
in class WCGraphicsContext
public void rotate(float radians)
rotate
in class WCGraphicsContext
protected boolean shouldRenderRect(float x, float y, float w, float h, DropShadow shadow, BasicStroke stroke)
protected boolean shouldRenderShape(Shape shape, DropShadow shadow, BasicStroke stroke)
protected boolean shouldCalculateIntersection()
public void fillRect(float x, float y, float w, float h, java.lang.Integer rgba)
fillRect
in class WCGraphicsContext
public void fillRoundedRect(float x, float y, float w, float h, float topLeftW, float topLeftH, float topRightW, float topRightH, float bottomLeftW, float bottomLeftH, float bottomRightW, float bottomRightH, int rgba)
fillRoundedRect
in class WCGraphicsContext
public void clearRect(float x, float y, float w, float h)
clearRect
in class WCGraphicsContext
public void setFillColor(int rgba)
setFillColor
in class WCGraphicsContext
public void setFillGradient(WCGradient gradient)
setFillGradient
in class WCGraphicsContext
public void setTextMode(boolean fill, boolean stroke, boolean clip)
setTextMode
in class WCGraphicsContext
public void setFontSmoothingType(int fontSmoothingType)
setFontSmoothingType
in class WCGraphicsContext
public int getFontSmoothingType()
getFontSmoothingType
in class WCGraphicsContext
public void setStrokeStyle(int style)
setStrokeStyle
in class WCGraphicsContext
public void setStrokeColor(int rgba)
setStrokeColor
in class WCGraphicsContext
public void setStrokeWidth(float width)
setStrokeWidth
in class WCGraphicsContext
public void setStrokeGradient(WCGradient gradient)
setStrokeGradient
in class WCGraphicsContext
public void setLineDash(float offset, float... sizes)
setLineDash
in class WCGraphicsContext
public void setLineCap(int lineCap)
setLineCap
in class WCGraphicsContext
public void setLineJoin(int lineJoin)
setLineJoin
in class WCGraphicsContext
public void setMiterLimit(float miterLimit)
setMiterLimit
in class WCGraphicsContext
public void setShadow(float dx, float dy, float blur, int rgba)
setShadow
in class WCGraphicsContext
public void drawPolygon(WCPath path, boolean shouldAntialias)
drawPolygon
in class WCGraphicsContext
public void drawLine(int x0, int y0, int x1, int y1)
drawLine
in class WCGraphicsContext
public void drawPattern(WCImage texture, WCRectangle srcRect, WCTransform patternTransform, WCPoint phase, WCRectangle destRect)
drawPattern
in class WCGraphicsContext
public void drawImage(WCImage img, float dstx, float dsty, float dstw, float dsth, float srcx, float srcy, float srcw, float srch)
drawImage
in class WCGraphicsContext
public void drawBitmapImage(java.nio.ByteBuffer image, int x, int y, int w, int h)
drawBitmapImage
in class WCGraphicsContext
public void drawIcon(WCIcon icon, int x, int y)
drawIcon
in class WCGraphicsContext
public void drawRect(int x, int y, int w, int h)
drawRect
in class WCGraphicsContext
public void drawString(WCFont f, int[] glyphs, float[] advances, float x, float y)
drawString
in class WCGraphicsContext
public void drawString(WCFont f, java.lang.String str, boolean rtl, int from, int to, float x, float y)
drawString
in class WCGraphicsContext
public void setComposite(int composite)
setComposite
in class WCGraphicsContext
public void drawEllipse(int x, int y, int w, int h)
drawEllipse
in class WCGraphicsContext
public void drawFocusRing(int x, int y, int w, int h, int rgba)
drawFocusRing
in class WCGraphicsContext
public void setAlpha(float alpha)
setAlpha
in class WCGraphicsContext
public float getAlpha()
getAlpha
in class WCGraphicsContext
public void beginTransparencyLayer(float opacity)
beginTransparencyLayer
in class WCGraphicsContext
public void endTransparencyLayer()
endTransparencyLayer
in class WCGraphicsContext
public void drawWidget(RenderTheme theme, Ref widget, int x, int y)
drawWidget
in class WCGraphicsContext
public void drawScrollbar(ScrollBarTheme theme, Ref widget, int x, int y, int pressedPart, int hoveredPart)
drawScrollbar
in class WCGraphicsContext
static Color createColor(int rgba)
private static Color4f createColor4f(int rgba)
private DropShadow createShadow(float dx, float dy, float blur, int rgba)
private void render(Graphics g, Effect effect, Paint paint, BasicStroke stroke, NGNode node)
private static FilterContext getFilterContext(Graphics g)
public void strokeArc(int x, int y, int w, int h, int startAngle, int angleSpan)
strokeArc
in class WCGraphicsContext
public WCImage getImage()
getImage
in class WCGraphicsContext
public void strokeRect(float x, float y, float w, float h, float lineWidth)
strokeRect
in class WCGraphicsContext
public void strokePath(WCPath path)
strokePath
in class WCGraphicsContext
public void fillPath(WCPath path)
fillPath
in class WCGraphicsContext
public void setPerspectiveTransform(WCTransform tm)
setPerspectiveTransform
in class WCGraphicsContext
public void setTransform(WCTransform tm)
setTransform
in class WCGraphicsContext
public WCTransform getTransform()
getTransform
in class WCGraphicsContext
public void concatTransform(WCTransform tm)
concatTransform
in class WCGraphicsContext
public void flush()
flush
in class WCGraphicsContext
public WCGradient createLinearGradient(WCPoint p1, WCPoint p2)
createLinearGradient
in class WCGraphicsContext
public WCGradient createRadialGradient(WCPoint p1, float r1, WCPoint p2, float r2)
createRadialGradient
in class WCGraphicsContext