ro.sync.ecss.extensions.api
Class WidthRepresentation
java.lang.Object
  
ro.sync.ecss.extensions.api.WidthRepresentation
- All Implemented Interfaces: 
 - java.io.Serializable
 
@API(type=EXTENDABLE,
     src=PUBLIC)
public class WidthRepresentation- extends java.lang.Object
- implements java.io.Serializable
  
Specifies the fixed and relative width determined from the value of width/colwidth 
 attribute of the col.
- See Also:
 - Serialized Form
 
 
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
DEFAULT_WIDTH_REPRESENTATION
public static WidthRepresentation DEFAULT_WIDTH_REPRESENTATION
- The default width representation.
 
WidthRepresentation
public WidthRepresentation(float fixedWidthValue,
                           WidthRepresentation.Unit fixedWidthUnit,
                           float relativeWidth,
                           boolean isRelativeToParent)
- Constructor.
- Parameters:
 fixedWidthValue - The fixed width value. Ex: 2.5fixedWidthUnit - The unit of fixed width. Defaults to PIXEL.relativeWidth - The relative width part. Ex: 0.33isRelativeToParent - If true then the relative width represents
        a percentage of the parent table width, otherwise the relative value
        represent a proportional width which is evaluated taking into account 
        the proportional values of the other columns.    
        
For example, if there are two columns with 70% and 30% relative widths then
        the table total width will be divided according with this values. 
        
If the relative widths for the two columns are specified in proportional units and,
        for example, have the values 1 for the first column and 2 for the second column
        then the second column will be twice as large as the first one.
 
WidthRepresentation
public WidthRepresentation(java.lang.String widthString,
                           boolean acceptPercents)
- Constructor.
 Create a ColWidth corresponding to the given width representation.
- Parameters:
 widthString - The string representation of the Width. The 
      representation format must be a sum of terms with the following format: 
      n(*|%|units). If there are more that one terms with the same form (fixed 
      or relative) then corresponding width (fixed or relative) will be reseted.acceptPercents - If true then percentage values are
      accepted
 
getFixedWidth
public float getFixedWidth()
 
- Returns:
 - Returns the fixed width part of the width representation. Ex: 2.5
 
 
getFixedWidthUnit
public WidthRepresentation.Unit getFixedWidthUnit()
 
- Returns:
 - Returns the fixed width unit. Ex: Unit.CENTIMETER
 
 
getRelativeWidth
public float getRelativeWidth()
 
- Returns:
 - Returns the relative width part of the width representation.
 
 
isRelativeToParent
public boolean isRelativeToParent()
 
- Returns:
 - Returns 
true if the relative part of the width is expressed
 relative to the parent width, false if is expressed relative to other siblings. 
 
isApplicable
public boolean isApplicable()
 
- Returns:
 true if the current width representation should be taken
 into account when building the layout.
 
toString
public java.lang.String toString()
- Overrides:
 toString in class java.lang.Object
 
- See Also:
 Object.toString()
 
getWidthRepresentation
public java.lang.String getWidthRepresentation()
 
- Returns:
 - The string representation of the width. The format of the width is 
 
 
 [fixed_width][fixed_width_unit] + [relative_width %|*] 
  
 
© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.