SourceForge.net Logo
aXSL API 0.1

org.axsl.foR
Interface WritingMode


public interface WritingMode

Writing Mode is not a datatype recognized in XSL-FO. However, its definition in the standard makes it a de facto compound data type. It is discussed in the XSL-FO Standard 1.0 at Section 7.27.7 and at Appendix A.1. Please note that most applications using members of this class will not want to deal with the different ipd and shift values for odd and even line numbers. In that case, it is recommended that they simply use the odd value for each.


Method Summary
 byte getAbsoluteAxis(byte relativeAxis)
          Converts a relative axis(block-progression or inline-progress) to an absolute axis (horizontal or vertical) for this writing mode.
 byte getAbsoluteDirection(byte relativeDir)
          Given a relative direction, this method returns the corresponding absolute direction in this writing mode.
 byte getAbsoluteDirFromRelativeAxis(byte relativeAxis)
          Given a relative axis, this method returns the related absolute direction that applies to that axis.
 byte getAfter()
          Tells which absolute direction is the "before" direction.
 byte getBefore()
          Tells which absolute direction is the "before" direction.
 byte getBottom()
          Tells which relative direction is the "bottom" direction.
 byte getBPAxis()
          Tells which axis (horizontal or vertical) is the block-progression axis.
 byte getBPDirection()
          Returns the block-progression-direction for this writing-mode.
 int getCorresponding(int inputDirection)
          If given a relative direction, this method returns the corresponding absolute direction; if given an absolute direction, this method returns the corresponding relative direction.
 byte getEnd()
          Tells which absolute direction is the "end" direction.
 byte getHorizontalAxis()
          Tells which axis (block-progression or inline-progression) is the horizontal axis.
 byte getIPAxis()
          Tells which axis (horizontal or vertical) is the inline-progression axis.
 byte getIPDirectionEven()
          Returns the inline-progression-direction for even-numbered lines for this writing-mode.
 byte getIPDirectionOdd()
          Returns the inline-progression-direction for odd-numbered lines for this writing-mode.
 byte getLeft()
          Tells which relative direction is the "left" direction.
 byte getRelativeAxis(byte absoluteAxis)
          Converts an absolute axis(horizontal or vertical) to a relative axis (inline-progression or block-progression) for this writing mode.
 byte getRelativeDirection(byte absoluteDir)
          Given an absolute direction, this method returns the corresponding relative direction for this writing-mode.
 byte getRight()
          Tells which relative direction is the "right" direction.
 byte getShiftEven()
          Returns the shift-direction for even-numbered lines for this writing-mode.
 byte getShiftOdd()
          Returns the shift-direction for odd-numbered lines for this writing-mode.
 byte getStart()
          Tells which absolute direction is the "start" direction.
 byte getTop()
          Tells which relative direction is the "top" direction.
 byte getVerticalAxis()
          Tells which axis (block-progression or inline-progression) is the vertical axis.
 boolean isPaired()
          Indicates whether characters are written in pairs in this writing-mode.
 

Method Detail

getBPDirection

public byte getBPDirection()
Returns the block-progression-direction for this writing-mode.

Returns:
The block-progression-direction for this writing-mode, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT.

getIPDirectionEven

public byte getIPDirectionEven()
Returns the inline-progression-direction for even-numbered lines for this writing-mode.

Returns:
Returns the inline-progression-direction for even-numbered lines for this writing-mode, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT.

getIPDirectionOdd

public byte getIPDirectionOdd()
Returns the inline-progression-direction for odd-numbered lines for this writing-mode.

Returns:
Returns the inline-progression-direction for odd-numbered lines for this writing-mode, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT.

isPaired

public boolean isPaired()
Indicates whether characters are written in pairs in this writing-mode.

Returns:
Returns true if characters are written in pairs in this writing-mode.

getShiftEven

public byte getShiftEven()
Returns the shift-direction for even-numbered lines for this writing-mode.

Returns:
Returns the shift-direction for even-numbered lines for this writing-mode, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT.

getShiftOdd

public byte getShiftOdd()
Returns the shift-direction for odd-numbered lines for this writing-mode.

Returns:
Returns the shift-direction for odd-numbered lines for this writing-mode, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT.

getHorizontalAxis

public byte getHorizontalAxis()
Tells which axis (block-progression or inline-progression) is the horizontal axis.

Returns:
Either Constants.AXIS_BP or Constants.AXIS_IP, or -1 if writing-mode is invalid.

getVerticalAxis

public byte getVerticalAxis()
Tells which axis (block-progression or inline-progression) is the vertical axis.

Returns:
Either Constants.AXIS_BP or Constants.AXIS_IP, or -1 if writing-mode is invalid.

getBPAxis

public byte getBPAxis()
Tells which axis (horizontal or vertical) is the block-progression axis.

Returns:
Either Constants.AXIS_HORIZONTAL or Constants.AXIS_VERTICAL, or -1 if writing-mode is invalid.

getIPAxis

public byte getIPAxis()
Tells which axis (horizontal or vertical) is the inline-progression axis.

Returns:
Either Constants.AXIS_HORIZONTAL or Constants.AXIS_VERTICAL, or -1 if writing-mode is invalid.

getAbsoluteAxis

public byte getAbsoluteAxis(byte relativeAxis)
Converts a relative axis(block-progression or inline-progress) to an absolute axis (horizontal or vertical) for this writing mode.

Parameters:
relativeAxis - Either Constants.AXIS_BP or Constants.AXIS_IP.
Returns:
Either Constants.AXIS_HORIZONTAL or Constants.AXIS_VERTICAL, or -1 if writing-mode or input is invalid.

getRelativeAxis

public byte getRelativeAxis(byte absoluteAxis)
Converts an absolute axis(horizontal or vertical) to a relative axis (inline-progression or block-progression) for this writing mode.

Parameters:
absoluteAxis - Either Constants.AXIS_HORIZONTAL or Constants.AXIS_VERTICAL.
Returns:
Either Constants.AXIS_IP or Constants.AXIS_BP, or -1 if writing-mode or input is invalid.

getStart

public byte getStart()
Tells which absolute direction is the "start" direction.

Returns:
One of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM, or -1 if writing-mode is invalid.

getEnd

public byte getEnd()
Tells which absolute direction is the "end" direction.

Returns:
One of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM, or -1 if writing-mode is invalid.

getBefore

public byte getBefore()
Tells which absolute direction is the "before" direction.

Returns:
One of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM, or -1 if writing-mode is invalid.

getAfter

public byte getAfter()
Tells which absolute direction is the "before" direction.

Returns:
One of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM, or -1 if writing-mode is invalid.

getLeft

public byte getLeft()
Tells which relative direction is the "left" direction.

Returns:
One of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, Constants.DIRECTION_AFTER, or -1 if writing-mode is invalid.

getRight

public byte getRight()
Tells which relative direction is the "right" direction.

Returns:
One of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, Constants.DIRECTION_AFTER, or -1 if writing-mode is invalid.

getTop

public byte getTop()
Tells which relative direction is the "top" direction.

Returns:
One of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, Constants.DIRECTION_AFTER, or -1 if writing-mode is invalid.

getBottom

public byte getBottom()
Tells which relative direction is the "bottom" direction.

Returns:
One of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, Constants.DIRECTION_AFTER, or -1 if writing-mode is invalid.

getAbsoluteDirection

public byte getAbsoluteDirection(byte relativeDir)
Given a relative direction, this method returns the corresponding absolute direction in this writing mode.

Parameters:
relativeDir - One of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, or Constants.DIRECTION_AFTER.
Returns:
The corresponding absolute direction, one of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM, or -1 for invalid input or writing mode.

getAbsoluteDirFromRelativeAxis

public byte getAbsoluteDirFromRelativeAxis(byte relativeAxis)
Given a relative axis, this method returns the related absolute direction that applies to that axis.

Parameters:
relativeAxis - One of Constants.AXIS_BP or Constants.AXIS_IP.
Returns:
The corresponding absolute direction, one of Constants.DIRECTION_TOP_TO_BOTTOM, Constants.DIRECTION_BOTTOM_TO_TOP, Constants.DIRECTION_LEFT_TO_RIGHT, or Constants.DIRECTION_RIGHT_TO_LEFT, or -1 for invalid input or writing mode.

getRelativeDirection

public byte getRelativeDirection(byte absoluteDir)
Given an absolute direction, this method returns the corresponding relative direction for this writing-mode.

Parameters:
absoluteDir - One of Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, or Constants.DIRECTION_BOTTOM.
Returns:
The corresponding relative direction, one of Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, Constants.DIRECTION_AFTER, or -1 for invalid input or writing mode.

getCorresponding

public int getCorresponding(int inputDirection)
If given a relative direction, this method returns the corresponding absolute direction; if given an absolute direction, this method returns the corresponding relative direction.

Parameters:
inputDirection - Either a relative direction constant (Constants.DIRECTION_START, Constants.DIRECTION_END, Constants.DIRECTION_BEFORE, or Constants.DIRECTION_AFTER), or an absolute direction constant (Constants.DIRECTION_LEFT, Constants.DIRECTION_RIGHT, Constants.DIRECTION_TOP, Constants.DIRECTION_BOTTOM) to be converted.
Returns:
For absolute direction input, the corresponding relative direction. For relative direction input, the corresponding absolute direction. For an error either in the input or a bad writing mode, -1.

SourceForge.net Logo
aXSL API 0.1

This documentation was created September 6 2006 by The aXSL Group and may be freely copied. See license for details.