fi.hut.tml.xsmiles.mlfc.smil.basic
Class AttributeHandler

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.basic.AttributeHandler

public class AttributeHandler
extends java.lang.Object

AttributeHandler parses and returns a value of one attribute.


Field Summary
static int bottom
           
static int height
           
static int left
           
static int right
           
static int top
           
static int width
           
 
Constructor Summary
protected AttributeHandler()
           
 
Method Summary
static int convertAmountToString(java.lang.String s)
           
static int convertHorizStringToInt(java.lang.String value, LayoutCalc parent)
           
static int convertPercentageToInt(java.lang.String p, int attributeType, SMILElement e)
           
static int convertSizeStringToInt(java.lang.String value, int size)
          Converts CSS2 size values to integer sizes, relative to the given size (width/height).
static int convertSizeStringToInt2(java.lang.String s, int attributeType, SMILElement e)
          Converts CSS2 size values to integer sizes, relative to the given element (RootLayout/Region).
static int convertVertStringToInt(java.lang.String value, LayoutCalc parent)
           
static boolean evaluateSystemValues(org.w3c.dom.Element element, Viewer viewer, boolean customTest)
          Evaluates the "system-xxx" attributes for the element and returns value true/false.
static boolean getSystemRequired(java.lang.String prefix, org.w3c.dom.Element element, Viewer viewer)
          Go through parent elements and search for the prefix definition to find out the related URL.
static int intOrRepeatToInt(java.lang.String s)
           
static boolean isPercentage(java.lang.String s)
          Is the value percentage value?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

top

public static final int top
See Also:
Constant Field Values

left

public static final int left
See Also:
Constant Field Values

width

public static final int width
See Also:
Constant Field Values

height

public static final int height
See Also:
Constant Field Values

right

public static final int right
See Also:
Constant Field Values

bottom

public static final int bottom
See Also:
Constant Field Values
Constructor Detail

AttributeHandler

protected AttributeHandler()
Method Detail

evaluateSystemValues

public static boolean evaluateSystemValues(org.w3c.dom.Element element,
                                           Viewer viewer,
                                           boolean customTest)
Evaluates the "system-xxx" attributes for the element and returns value true/false. This method is static, so it can be called from DocumentHandler for head switch element. NOT DONE: This method also tests the skip-content attribute for elements, which implement ElementSkipContent interface.

Returns:
Evaluated true/false-condition

getSystemRequired

public static boolean getSystemRequired(java.lang.String prefix,
                                        org.w3c.dom.Element element,
                                        Viewer viewer)
Go through parent elements and search for the prefix definition to find out the related URL.

Returns:
true if the prefix is supported by the X-Smiles

intOrRepeatToInt

public static int intOrRepeatToInt(java.lang.String s)

isPercentage

public static boolean isPercentage(java.lang.String s)
Is the value percentage value?

Parameters:
s - value to be checked
Returns:
true if s is a percentage value

convertVertStringToInt

public static int convertVertStringToInt(java.lang.String value,
                                         LayoutCalc parent)

convertHorizStringToInt

public static int convertHorizStringToInt(java.lang.String value,
                                          LayoutCalc parent)

convertSizeStringToInt

public static int convertSizeStringToInt(java.lang.String value,
                                         int size)
Converts CSS2 size values to integer sizes, relative to the given size (width/height). Accepts absolute coordinates even if size is zero. If the size is zero, and percentages are used, this will return zero values.

Parameters:
value - Percentage/absolute value

convertSizeStringToInt2

public static int convertSizeStringToInt2(java.lang.String s,
                                          int attributeType,
                                          SMILElement e)
Converts CSS2 size values to integer sizes, relative to the given element (RootLayout/Region). Accepts absolute coordinates even if SMILElement is null. If the element is null and percentages are used, this will return zero values. But will not crash.

Parameters:
s - Percentage/absolute value
attributeType - top/bottom/left/right/width/height - type of the attribute
e - RootLayoutElement or RegionElement - width or height for %

convertAmountToString

public static int convertAmountToString(java.lang.String s)

convertPercentageToInt

public static int convertPercentageToInt(java.lang.String p,
                                         int attributeType,
                                         SMILElement e)


X-Smiles 1.2