Oxygen XML Editor 11.2 Author API

ro.sync.ecss.extensions.api
Class WidthRepresentation

java.lang.Object
  extended by ro.sync.ecss.extensions.api.WidthRepresentation

public class WidthRepresentation
extends Object

Specifies the fixed and relative width determined from the value of width/colwidth attribute.


Nested Class Summary
static class WidthRepresentation.Unit
          The fixed width unit.
 
Field Summary
static WidthRepresentation DEFAULT_WIDTH_REPRESENTATION
          The default width representation.
 
Constructor Summary
WidthRepresentation(float fixedWidth, WidthRepresentation.Unit fixedWidthUnit, float relativeWidth, boolean isRelativeToParent)
          Constructor.
WidthRepresentation(String widthRepresentation, boolean acceptPercents)
          Constructor.
 
Method Summary
 float getFixedWidth()
           
 WidthRepresentation.Unit getFixedWidthUnit()
           
 float getRelativeWidth()
           
 String getWidthRepresentation()
           
 boolean isApplicable()
           
 boolean isRelativeToParent()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH_REPRESENTATION

public static WidthRepresentation DEFAULT_WIDTH_REPRESENTATION
The default width representation.

Constructor Detail

WidthRepresentation

public WidthRepresentation(float fixedWidth,
                           WidthRepresentation.Unit fixedWidthUnit,
                           float relativeWidth,
                           boolean isRelativeToParent)
Constructor.

Parameters:
fixedWidth - The fixed width part.
fixedWidthUnit - The unit of fixed width. Defaults to PIXEL.
relativeWidth - The relative width part.
isRelativeToParent - 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(String widthRepresentation,
                           boolean acceptPercents)
Constructor. Create a ColWidth corresponding to the given width representation.

Parameters:
widthRepresentation - 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
Method Detail

getFixedWidth

public float getFixedWidth()
Returns:
Returns the fixed width part of the width representation.

getFixedWidthUnit

public WidthRepresentation.Unit getFixedWidthUnit()
Returns:
Returns the fixed width unit.

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 String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getWidthRepresentation

public String getWidthRepresentation()
Returns:
The string representation of the width. The format of the width is
[fixed_width][fixed_width_unit] + [relative_width %|*]

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.