TinyLine 2.5

com.tinyline.svg
Class SVGSVGElem

java.lang.Object
  extended by com.tinyline.svg.SVGNode
      extended by com.tinyline.svg.SVGGroupElem
          extended by com.tinyline.svg.SVGSVGElem

public class SVGSVGElem
extends SVGGroupElem

The SVGSVGElem class implements the 'svg' element.

An SVG document fragment consists of any number of SVG elements contained within an 'svg' element.

An SVG document fragment can range from an empty fragment (i.e., no content inside of the 'svg' element), to a very simple SVG document fragment containing a single SVG graphics element such as a 'rect', to a complex, deeply nested collection of container elements and graphics elements.

Version:
2.2

Field Summary
static boolean AUTOFIT
          The hint provided by the TinyLine application to choose the viewport location and size.
 TinyString baseProfile
          Describes the minimum SVG language profile that the author believes is necessary to correctly render the content.
 TinyVector cameraXform
          The additional "Camera" transform
 int preserveAspectRatio
          The 'preserveAspectRatio' attribute is used for adapting the content to devices with different display aspect ratios.
 TinyString version
          Indicates the SVG language version to which this document fragment conforms.
 SVGRect viewBox
          The viewBox specify that a given set of graphics stretch to fit a particular container element.
 SVGRect viewPort
          The viewport is the finite rectangular region of the canvas where actual rendering occurs.
 TinyVector viewXform
          The transform from viewBox (USER COORDS) to voewPort (DEVICE COORDS)
 int zoomAndPan
          The 'zoomAndPan' attribute defines the ability to magnify and pan.
 
Fields inherited from class com.tinyline.svg.SVGGroupElem
showBounds, xlink_href
 
Fields inherited from class com.tinyline.svg.SVGNode
animatedVals, attrs, 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
SVGSVGElem()
          Constructs a new empty SVGSVGElem.
 
Method Summary
 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 getCurrentScale()
          Returns the current scale factor
 int recalcViewXform()
          Recalculates the current transform from the viewbox to the viewport Caclulates viewXform xform: - scale matrix at viewXform.data[0] - translate matrix at viewXform.data[1] Here: viewPort is defined as viewBox is defined as
 int setAttribute(int hattr, java.lang.Object value)
          Assigns or modifies the value of the specified attribute.
 int setCurrentScale(int scale)
          Sets the current scale factor
 int setCurrentTranslate(int tx, int ty)
          Sets the current translate to the point (tx, ty)
 
Methods inherited from class com.tinyline.svg.SVGGroupElem
copyNode, getDevBounds, nodeHitAt, paint
 
Methods inherited from class com.tinyline.svg.SVGNode
addChild, contains, getBounds, getCapStyle, getCurrentColor, getDashArray, getDashOffset, getDisplay, getFillColor, getFillOpacity, getFillRule, getFontFamily, getFontSize, getGlobalTransform, getJoinStyle, getLineThickness, getMiterLimit, getNodeById, getOpacity, getStopColor, getStopOpacity, getStrokeColor, getStrokeOpacity, getTextAnchor, getVisibility, intersects, isDisplay, isVisible, matchUserAgent, removeChild, resolveColor, seekAElem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTOFIT

public static boolean AUTOFIT
The hint provided by the TinyLine application to choose the viewport location and size. If the AUTOFIT is true (default value) then the SVG image fits the TinyPixbuf size.


baseProfile

public TinyString baseProfile
Describes the minimum SVG language profile that the author believes is necessary to correctly render the content.


cameraXform

public TinyVector cameraXform
The additional "Camera" transform


preserveAspectRatio

public int preserveAspectRatio
The 'preserveAspectRatio' attribute is used for adapting the content to devices with different display aspect ratios.

In SVGT the 'align' parameter can only be either 'none' or 'XMidYMid', the 'meetOrSlice' parameter can only be 'meet'.

Value: ( SVG.NONE | SVG.XMIDYMID_MEET )

Animatable: Yes

Init: SVG.XMIDYMID_MEET


version

public TinyString version
Indicates the SVG language version to which this document fragment conforms.


viewBox

public SVGRect viewBox
The viewBox specify that a given set of graphics stretch to fit a particular container element.


viewPort

public SVGRect viewPort
The viewport is the finite rectangular region of the canvas where actual rendering occurs.


viewXform

public TinyVector viewXform
The transform from viewBox (USER COORDS) to voewPort (DEVICE COORDS)


zoomAndPan

public int zoomAndPan
The 'zoomAndPan' attribute defines the ability to magnify and pan.

If disable, the user agent shall disable any magnification and panning controls and not allow the user to magnify or pan on the given document fragment.

If magnify, in environments that support user interactivity, the user agent shall provide controls to allow the user to perform a "magnify" operation on the document fragment.

Value: ( SVG.DISABLE | SVG.MAGNIFY )

Animatable: No

Init: SVG.MAGNIFY

Constructor Detail

SVGSVGElem

public SVGSVGElem()
Constructs a new empty SVGSVGElem.

Method Detail

createOutline

public int createOutline()
Description copied from class: SVGGroupElem
Creates an outline of this node.

Overrides:
createOutline in class SVGGroupElem

getAttribute

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

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

getCurrentScale

public int getCurrentScale()
Returns the current scale factor


recalcViewXform

public int recalcViewXform()
Recalculates the current transform from the viewbox to the viewport Caclulates viewXform xform: - scale matrix at viewXform.data[0] - translate matrix at viewXform.data[1] Here: viewPort is defined as viewBox is defined as


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 SVGGroupElem
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.

setCurrentScale

public int setCurrentScale(int scale)
Sets the current scale factor


setCurrentTranslate

public int setCurrentTranslate(int tx,
                               int ty)
Sets the current translate to the point (tx, ty)


TinyLine 2.5

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