FileDocCategorySizeDatePackage
GraphicsNode.javaAPI DocphoneME MR2 API (J2ME)8439Wed May 02 18:00:34 BST 2007com.sun.perseus.model

GraphicsNode

public interface GraphicsNode implements DecoratedNode, com.sun.perseus.j2d.GraphicsProperties
GraphicsNode is the interface that all ModelNode (see {@link com.sun.perseus.model.ModelNode ModelNode}) which correspond to graphical content implement.
GraphicsNodes have a notion of visibility and display. If a node is not displayed, then it does not paint and none of its children (if present) are painted. If a node is invisible, then it does no paint itself, but it paints it's children. In other words, it a node is invisible, its chidren may be visible (depending on the children's own visibility setting), but if a node is not displayed, then its children are not displayed either, no matter what their own display setting is. This corresponds to the CSS 2 concept of visibility and display.
IMPORTANT NOTE: Setting a property on a GraphicsNode automatically sets the inherited and color relative flags to false.
see
ModelNode
version
$Id: GraphicsNode.java,v 1.5 2006/06/29 10:47:31 ln156897 Exp $

Fields Summary
int
PROPERTY_FILL
The fill property controls the color of the fill operation
int
PROPERTY_STROKE
The stroke property controls the color of the stroke
int
PROPERTY_COLOR
The color property controls the 'current color'. The current color defines the value of the fill or stroke properties when they are 'color relative'.
int
PROPERTY_FILL_RULE
The fill rule property controls how the interior of shapes is computed.
int
PROPERTY_STROKE_WIDTH
The stroke width property controls how wide the stroke is.
int
PROPERTY_STROKE_LINE_JOIN
The stroke line join property defines the style of miter, i.e., the style of elbows between segments.
int
PROPERTY_STROKE_LINE_CAP
The stroke line cap property defines the style of line caps, i.e., the style of the end and begining of line strokes.
int
PROPERTY_STROKE_MITER_LIMIT
Provides a way to limit the extent of 'spikes' out of angle elbows.
int
PROPERTY_STROKE_DASH_ARRAY
Array defining the stroke's dash pattern.
int
PROPERTY_STROKE_DASH_OFFSET
Offset in the stroke dash array
int
PROPERTY_DISPLAY
Controls the offset in the dash array, in user space
int
PROPERTY_VISIBILITY
Controls whether a node is visible or not. Children of a node which is not visible can still be visible.
int
PROPERTY_FILL_OPACITY
Controls the opacity used in a fill operation.
int
PROPERTY_STROKE_OPACITY
Controls the opacity used in a stroking operation.
int
PROPERTY_OPACITY
Controls the opacity used in blending the offscreen image into the current background.
int
DEFAULT_INHERITANCE
Default inheritance setting (Y=yes, N=no):
- Y fill
- Y stroke
- Y color
- Y fill rule

- Y stroke width
- Y line join
- Y line cap
- Y miter limit

- Y dash array
- Y dash offset
- N display
- Y visibility

- Y fill opacity
- Y stroke opacity
- N opacity
int
DEFAULT_COLOR_RELATIVE
Default color relative (Y=yes, N=no):
- N fill
- N stroke
- N color
- N fill rule

- N stroke width
- N line join
- N line cap
- N miter limit

- N dash array
- N dash offset
- N display
- N visibility

- N fill opacity
- N stroke opacity
- N opacity
int
NUMBER_OF_PROPERTIES
Number of properties in a GraphicsNode
Constructors Summary
Methods Summary
public booleanisColorRelative(int propertyIndex)

param
propertyIndex index of the property to check
return
true if the input property is color relative. False otherwise
see
#setColorRelative

public booleanisColorRelativeProperty(int propertyIndex)
Returns true if the input property can be color-relative.

param
propertyIndex the index of the property which may be color-relative.
return
true if the input property can be color relative. False otherwise.

public voidsetColorRelative(int propertyIndex, boolean isColorRelative)
Sets the input property as a color-relative property. There are two color-relative properties on a GraphicsNode: fill and stroke. For all other properties, setting the property as color relative should not have effect. For fill and stroke, setting them as color relative means that the color property should be used for the corresponding fill or draw operations.

param
propertyIndex index of the property
param
isColorRelative the new state fot the property's color relative value.