Top Fields Constructors Methods
com.sun.javafx.sg.prism

public Class NGRectangle

extends NGShape
Class Inheritance
Imports
com.sun.javafx.geom.RectBounds, .RectangularShape, .RoundRectangle2D, .Shape, com.sun.javafx.geom.transform.BaseTransform, com.sun.prism.BasicStroke, .Graphics, .RectShadowGraphics, com.sun.prism.paint.Color, com.sun.prism.shape.ShapeRep, com.sun.scenario.effect.Effect

Field Summary

Modifier and TypeField and Description
pack-priv static final float
private RoundRectangle2D
private static final double
Inherited from com.sun.javafx.sg.prism.NGShape:
drawPaintdrawStrokefillPaintmodeshapeRepTHRESHOLD

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected RectBounds
computeOpaqueRegion(RectBounds opaqueRegion)

Overrides com.sun.javafx.sg.prism.NGNode.computeOpaqueRegion.

Computes and returns the opaque region for this node.

protected ShapeRep
public final Shape
protected boolean
hasOpaqueRegion()

Overrides com.sun.javafx.sg.prism.NGShape.hasOpaqueRegion.

Called only on NGNode subclasses which override supportsOpaqueRegions() to return true, this method will return whether or not this NGNode is in a state where it has an opaque region to actually return.

private static boolean
protected final boolean

Returns:

whether this rectangle is axis aligned when rendered given node's and rendering transform
isRectClip
(BaseTransform xform, boolean permitRoundedRectangle)

Overrides com.sun.javafx.sg.prism.NGNode.isRectClip.

Returns whether a clip represented by this node can be rendered using axis aligned rect clip.

pack-priv boolean
pack-priv static boolean
rectContains(float x, float y, NGShape node, RectangularShape r)

protected void
private boolean
protected boolean
supportsOpaqueRegions()

Overrides com.sun.javafx.sg.prism.NGNode.supportsOpaqueRegions.

Gets whether this NGNode supports opaque regions at all.

public void
updateRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)

Inherited from com.sun.javafx.sg.prism.NGShape:
geometryChangedgetFillPaintgetModegetStrokeShapehasOverlappingContentsisSmoothrenderContentrenderContent2DsetDrawPaintsetDrawStrokesetDrawStrokesetFillPaintsetModesetSmoothvisualsChanged

Field Detail

HALF_MINUS_HALF_SQRT_HALFback to summary
pack-priv static final float HALF_MINUS_HALF_SQRT_HALF
rrectback to summary
private RoundRectangle2D rrect
SQRT_2back to summary
private static final double SQRT_2

Constructor Detail

NGRectangleback to summary
public NGRectangle()

Method Detail

computeOpaqueRegionback to summary
protected RectBounds computeOpaqueRegion(RectBounds opaqueRegion)

Overrides com.sun.javafx.sg.prism.NGNode.computeOpaqueRegion.

Doc from com.sun.javafx.sg.prism.NGNode.computeOpaqueRegion.

Computes and returns the opaque region for this node. This method

Annotations
@Override
createShapeRepback to summary
protected ShapeRep createShapeRep(Graphics g)

Overrides com.sun.javafx.sg.prism.NGShape.createShapeRep.

Annotations
@Override
getShapeback to summary
public final Shape getShape()

Implements abstract com.sun.javafx.sg.prism.NGShape.getShape.

Annotations
@Override
hasOpaqueRegionback to summary
protected boolean hasOpaqueRegion()

Overrides com.sun.javafx.sg.prism.NGShape.hasOpaqueRegion.

Doc from com.sun.javafx.sg.prism.NGNode.hasOpaqueRegion.

Called only on NGNode subclasses which override supportsOpaqueRegions() to return true, this method will return whether or not this NGNode is in a state where it has an opaque region to actually return. If this method returns true, a subsequent call to computeOpaqueRegion(com.sun.javafx.geom.RectBounds) must return a non-null result. Any state used in the computation of this method, when it changes, must result in a call to invalidateOpaqueRegion().

Returns:boolean

Whether this NGNode currently has an opaque region.

Annotations
@Override
hasRightAngleMiterAndNoDashesback to summary
private static boolean hasRightAngleMiterAndNoDashes(BasicStroke bs)
isRectClipback to summary
protected final boolean isRectClip(BaseTransform xform, boolean permitRoundedRectangle)

Overrides com.sun.javafx.sg.prism.NGNode.isRectClip.

Returns whether a clip represented by this node can be rendered using axis aligned rect clip. The return value depends on whether the rectangle has arcs, current rendering mode (stroked or not), and whether the transform is only translate or scale or something more complex.

Returns:boolean

whether this rectangle is axis aligned when rendered given node's and rendering transform

Annotations
@Override
isRoundedback to summary
pack-priv boolean isRounded()
rectContainsback to summary
pack-priv static boolean rectContains(float x, float y, NGShape node, RectangularShape r)
renderEffectback to summary
protected void renderEffect(Graphics g)

Overrides com.sun.javafx.sg.prism.NGNode.renderEffect.

Annotations
@Override
renderEffectDirectlyback to summary
private boolean renderEffectDirectly(Graphics g)
supportsOpaqueRegionsback to summary
protected boolean supportsOpaqueRegions()

Overrides com.sun.javafx.sg.prism.NGNode.supportsOpaqueRegions.

Doc from com.sun.javafx.sg.prism.NGNode.supportsOpaqueRegions.

Gets whether this NGNode supports opaque regions at all. Most node types do not, but some do. If an NGNode subclass is written to support opaque regions, it must override this method to return true. The subclass must then also override the computeDirtyRegion method to return the dirty region, or null if the node in its current state doesn't have one. This method is intended to be immutable.

Returns:boolean

Whether this NGNode implementation supports opaque regions. This could also have been implemented via an interface that some NGNodes implemented, but then we'd have instanceof checks which I'd rather avoid.

Annotations
@Override
updateRectangleback to summary
public void updateRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)