TinyLine
v2.0

com.tinyline.svg
Class SVGRectElem

java.lang.Object
  extended bycom.tinyline.svg.SVGNode
      extended bycom.tinyline.svg.SVGPathElem
          extended bycom.tinyline.svg.SVGRectElem

public class SVGRectElem
extends SVGPathElem

The SVGRectElem class implements the 'rect' element.

The 'rect' element defines a rectangle which is axis-aligned with the current user coordinate system. Rounded rectangles can be achieved by setting appropriate values for attributes rx and ry.

Version:
1.9

Author:
Andrew Girow

Field Summary
 int height
          The height of the rectangle
 int rx
          For rounded rectangles, the x-axis radius of the ellipse used to round off the corners of the rectangle
 int ry
          For rounded rectangles, the x-axis radius of the ellipse used to round off the corners of the rectangle
 int width
          The width of the rectangle
 int x
          The x-axis coordinate of the side of the rectangle which has the smaller x-axis coordinate value in the current user coordinate system.
 int y
          The y-axis coordinate of the side of the rectangle which has the smaller y-axis coordinate value in the current user coordinate system.
 
Fields inherited from class com.tinyline.svg.SVGPathElem
isAntialiased, path
 
Fields inherited from class com.tinyline.svg.SVGNode
animatedVals, bounds, children, color, display, fill, fillOpacity, fillRule, fontFamily, fontSize, fontStyle, fontWeight, helem, id, opacity, outlined, ownerDocument, parent, stopColor, stopOpacity, stroke, strokeDashArray, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, strokeOpacity, strokeWidth, textAnchor, transform, visibility, xmlSpace
 
Constructor Summary
SVGRectElem()
          Constructs a new SVGRectElem.
SVGRectElem(SVGRectElem src)
          Constructs a copy of the given SVGRectElem node.
 
Method Summary
 SVGNode copyNode()
          Constructs a copy of the given node.
 int createOutline()
          Creates an outline of this node.
 java.lang.Object getAttribute(int hattr)
          Returns the value object for the given attribute, or null object otherwise.
 int setAttribute(int hattr, java.lang.Object value)
          Assigns or modifies the value of the specified attribute.
 
Methods inherited from class com.tinyline.svg.SVGPathElem
paint
 
Methods inherited from class com.tinyline.svg.SVGNode
addChild, contains, getBounds, getCapStyle, getCurrentColor, getDashArray, getDashOffset, getDevBounds, getDisplay, getFillColor, getFillOpacity, getFillRule, getFontFamily, getFontSize, getGlobalTransform, getJoinStyle, getLineThickness, getMiterLimit, getNodeById, getOpacity, getStopColor, getStopOpacity, getStrokeColor, getStrokeOpacity, getTextAnchor, getVisibility, intersects, isDisplay, isVisible, matchUserAgent, nodeHitAt, removeChild, resolveColor, seekAElem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rx

public int rx
For rounded rectangles, the x-axis radius of the ellipse used to round off the corners of the rectangle


ry

public int ry
For rounded rectangles, the x-axis radius of the ellipse used to round off the corners of the rectangle


x

public int x
The x-axis coordinate of the side of the rectangle which has the smaller x-axis coordinate value in the current user coordinate system.


y

public int y
The y-axis coordinate of the side of the rectangle which has the smaller y-axis coordinate value in the current user coordinate system.


width

public int width
The width of the rectangle


height

public int height
The height of the rectangle

Constructor Detail

SVGRectElem

public SVGRectElem()
Constructs a new SVGRectElem.


SVGRectElem

public SVGRectElem(SVGRectElem src)
Constructs a copy of the given SVGRectElem node.

Method Detail

copyNode

public SVGNode copyNode()
Constructs a copy of the given node.

Overrides:
copyNode in class SVGPathElem

setAttribute

public int setAttribute(int hattr,
                        java.lang.Object value)
                 throws java.lang.Exception
Assigns or modifies the value of the specified attribute.

Overrides:
setAttribute in class SVGPathElem
Parameters:
hattr - The attribute handle.
value - The value of the attribute.
Returns:
The error code that could be one of the following: SVG.ERR_OK, SVG.ERR_NUMBER_FORMAT, SVG.ERR_INVALID_ARG, SVG.ERR_NOT_FOUND, SVG.ERR_NOT_SUPPORTED, SVG.ERR_HIERARCHY_REQUEST
Throws:
java.lang.Exception - if the value type doesn not match to the attribute handle.

getAttribute

public java.lang.Object getAttribute(int hattr)
Returns the value object for the given attribute, or null object otherwise.

Overrides:
getAttribute in class SVGPathElem
Parameters:
hattr - The attribute handle.
Returns:
The value of the attribute or null.

createOutline

public int createOutline()
Creates an outline of this node.

Overrides:
createOutline in class SVGPathElem

TinyLine
v2.0

Provided under the terms of the TinyLine License Agreement that has been included with this distribution