com.powerml.structures.text
Class Ruler

java.lang.Object
  extended bycom.powerml.structures.text.Ruler
All Implemented Interfaces:
java.io.Serializable

public final class Ruler
extends java.lang.Object
implements java.io.Serializable

Instances of this class contain ruler properties, e.g. default tab width, user tabs, offsets etc. Rulers are assigned to texts.

See Also:
Serialized Form

Field Summary
static int DEFAULT_DEFAULT_TAB
          Default value for the default tab width
static int[] DEFAULT_FIRST_LINE_OFFSETS
          Default values for the first line's offsets (per indentation level)
static int[] DEFAULT_HANGING_OFFSETS
          Default values for hanging offsets (per indentation level)
static int[] DEFAULT_HEADER_FIRST_LINE_OFFSETS
          Default value for first line offset of header (0)
static int[] DEFAULT_HEADER_HANGING_OFFSETS
          Default value for hanging offset of header (0)
static int[] DEFAULT_SHAPE_FIRST_LINE_OFFSETS
          Default value for first line offset of text within shape
static int[] DEFAULT_SHAPE_HANGING_OFFSETS
          Default value for hanging offset of text within shape
static int[] DEFAULT_TITLE_BODY_FIRST_LINE_OFFSETS
          Default value for first line offset of text within title body
static int[] DEFAULT_TITLE_BODY_HANGING_OFFSETS
          Default value for hanging offset of text within title body
 
Method Summary
 void addXml(org.dom4j.Element parent, int textType)
          Transforms current instance to XML and adds it to a parent element.
 short getDefaultTab()
          Returns the default tab width, i.e. the indentation caused by a tab character if no user tab is defined.
 short[] getFirstLineOffsets()
          Returns an array containing the first line's offsets per indentation level.
 short[] getHangingOffsets()
          Returns an array containing the hanging offsets (i.e. the offsets of all lines in a paragraph except the first) per indentation level.
 java.util.ArrayList getTabs()
          Returns a list containing user defined tabs.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DEFAULT_TAB

public static final int DEFAULT_DEFAULT_TAB
Default value for the default tab width

See Also:
Constant Field Values

DEFAULT_FIRST_LINE_OFFSETS

public static final int[] DEFAULT_FIRST_LINE_OFFSETS
Default values for the first line's offsets (per indentation level)


DEFAULT_HANGING_OFFSETS

public static final int[] DEFAULT_HANGING_OFFSETS
Default values for hanging offsets (per indentation level)


DEFAULT_HEADER_FIRST_LINE_OFFSETS

public static final int[] DEFAULT_HEADER_FIRST_LINE_OFFSETS
Default value for first line offset of header (0)


DEFAULT_HEADER_HANGING_OFFSETS

public static final int[] DEFAULT_HEADER_HANGING_OFFSETS
Default value for hanging offset of header (0)


DEFAULT_SHAPE_FIRST_LINE_OFFSETS

public static final int[] DEFAULT_SHAPE_FIRST_LINE_OFFSETS
Default value for first line offset of text within shape


DEFAULT_SHAPE_HANGING_OFFSETS

public static final int[] DEFAULT_SHAPE_HANGING_OFFSETS
Default value for hanging offset of text within shape


DEFAULT_TITLE_BODY_FIRST_LINE_OFFSETS

public static final int[] DEFAULT_TITLE_BODY_FIRST_LINE_OFFSETS
Default value for first line offset of text within title body


DEFAULT_TITLE_BODY_HANGING_OFFSETS

public static final int[] DEFAULT_TITLE_BODY_HANGING_OFFSETS
Default value for hanging offset of text within title body

Method Detail

addXml

public void addXml(org.dom4j.Element parent,
                   int textType)
Transforms current instance to XML and adds it to a parent element.

Parameters:
parent - parent element
textType - clean strings of control characters

getDefaultTab

public short getDefaultTab()
Returns the default tab width, i.e. the indentation caused by a tab character if no user tab is defined.

Returns:
default tab width

getFirstLineOffsets

public short[] getFirstLineOffsets()
Returns an array containing the first line's offsets per indentation level. The array length is 5.

Returns:
first line offset widths

getHangingOffsets

public short[] getHangingOffsets()
Returns an array containing the hanging offsets (i.e. the offsets of all lines in a paragraph except the first) per indentation level. The array length is 5.

Returns:
hanging offset widths

getTabs

public java.util.ArrayList getTabs()
Returns a list containing user defined tabs.

Returns:
tabs


© 2004-2005 Ralf Terdic. All rights reserved.
www.powerml.com