SourceForge.net Logo
aXSL API 0.2

org.axsl.common.value
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
 AbsoluteAxis getAbsoluteAxis(RelativeAxis relativeAxis)
          Converts a relative axis(block-progression or inline-progress) to an absolute axis (horizontal or vertical) for this writing mode.
 AbsoluteCompass getAbsoluteDirection(RelativeCompass relativeDir)
          Given a relative direction, this method returns the corresponding absolute direction in this writing mode.
 AbsoluteDirection getAbsoluteDirFromRelativeAxis(RelativeAxis relativeAxis)
          Given a relative axis, this method returns the related absolute direction that applies to that axis.
 AbsoluteCompass getAfter()
          Tells which absolute direction is the "before" direction.
 AbsoluteCompass getBefore()
          Tells which absolute direction is the "before" direction.
 RelativeCompass getBottom()
          Tells which relative direction is the "bottom" direction.
 AbsoluteAxis getBpAxis()
          Tells which axis (horizontal or vertical) is the block-progression axis.
 AbsoluteDirection getBpDirection()
          Returns the block-progression-direction for this writing-mode.
 Compass getCorresponding(Compass 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.
 AbsoluteCompass getEnd()
          Tells which absolute direction is the "end" direction.
 RelativeAxis getHorizontalAxis()
          Tells which axis (block-progression or inline-progression) is the horizontal axis.
 AbsoluteAxis getIpAxis()
          Tells which axis (horizontal or vertical) is the inline-progression axis.
 AbsoluteDirection getIpDirectionEven()
          Returns the inline-progression-direction for even-numbered lines for this writing-mode.
 AbsoluteDirection getIpDirectionOdd()
          Returns the inline-progression-direction for odd-numbered lines for this writing-mode.
 RelativeCompass getLeft()
          Tells which relative direction is the "left" direction.
 RelativeAxis getRelativeAxis(AbsoluteAxis absoluteAxis)
          Converts an absolute axis(horizontal or vertical) to a relative axis (inline-progression or block-progression) for this writing mode.
 RelativeCompass getRelativeDirection(AbsoluteCompass absoluteDir)
          Given an absolute direction, this method returns the corresponding relative direction for this writing-mode.
 RelativeCompass getRight()
          Tells which relative direction is the "right" direction.
 AbsoluteDirection getShiftEven()
          Returns the shift-direction for even-numbered lines for this writing-mode.
 AbsoluteDirection getShiftOdd()
          Returns the shift-direction for odd-numbered lines for this writing-mode.
 AbsoluteCompass getStart()
          Tells which absolute direction is the "start" direction.
 RelativeCompass getTop()
          Tells which relative direction is the "top" direction.
 RelativeAxis 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

AbsoluteDirection getBpDirection()
Returns the block-progression-direction for this writing-mode.

Returns:
The block-progression-direction for this writing-mode, one of AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT.

getIpDirectionEven

AbsoluteDirection 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 AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT.

getIpDirectionOdd

AbsoluteDirection 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 AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT.

isPaired

boolean isPaired()
Indicates whether characters are written in pairs in this writing-mode. For example, the writing mode "tb-lr-in-lr-pairs" specifies that "text is written in two character, left-to-right, pairs. The pairs are then stacked top-to-bottom to form a line. Lines and blocks are stacked left-to-right."

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

getShiftEven

AbsoluteDirection getShiftEven()
Returns the shift-direction for even-numbered lines for this writing-mode. The shift-direction is the direction in which baseline shifts occur. For example, in the writing-mode lr-tb (left-to-right, top-to-bottom), the shift direction for all lines is bottom-to-top, which means that positive baseline-shift adjustments will move the baseline up and negative adjustments will move it down.

Returns:
Returns the shift-direction for even-numbered lines for this writing-mode, one of AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT.

getShiftOdd

AbsoluteDirection getShiftOdd()
Returns the shift-direction for odd-numbered lines for this writing-mode. The shift-direction is the direction in which baseline shifts occur. For example, in the writing-mode lr-tb (left-to-right, top-to-bottom), the shift direction for all lines is bottom-to-top, which means that positive baseline-shift adjustments will move the baseline up and negative adjustments will move it down.

Returns:
Returns the shift-direction for odd-numbered lines for this writing-mode, one of AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT.

getHorizontalAxis

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

Returns:
One of RelativeAxis.BLOCK_PROGRESSION or RelativeAxis.INLINE_PROGRESSION.

getVerticalAxis

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

Returns:
One of RelativeAxis.BLOCK_PROGRESSION or RelativeAxis.INLINE_PROGRESSION.

getBpAxis

AbsoluteAxis getBpAxis()
Tells which axis (horizontal or vertical) is the block-progression axis.

Returns:
One of AbsoluteAxis.HORIZONTAL or AbsoluteAxis.VERTICAL.

getIpAxis

AbsoluteAxis getIpAxis()
Tells which axis (horizontal or vertical) is the inline-progression axis.

Returns:
One of AbsoluteAxis.HORIZONTAL or AbsoluteAxis.VERTICAL.

getAbsoluteAxis

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

Parameters:
relativeAxis - Either RelativeAxis.BLOCK_PROGRESSION or RelativeAxis.INLINE_PROGRESSION.
Returns:
One of AbsoluteAxis.HORIZONTAL or AbsoluteAxis.VERTICAL.

getRelativeAxis

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

Parameters:
absoluteAxis - Either AbsoluteAxis.HORIZONTAL or AbsoluteAxis.VERTICAL.
Returns:
Either RelativeAxis.INLINE_PROGRESSION or RelativeAxis.BLOCK_PROGRESSION.

getStart

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

Returns:
One of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, or AbsoluteCompass.BOTTOM.

getEnd

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

Returns:
One of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, or AbsoluteCompass.BOTTOM. is invalid.

getBefore

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

Returns:
One of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, or AbsoluteCompass.BOTTOM.

getAfter

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

Returns:
One of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, or AbsoluteCompass.BOTTOM.

getLeft

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

Returns:
One of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.

getRight

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

Returns:
One of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.

getTop

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

Returns:
One of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.

getBottom

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

Returns:
One of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.

getAbsoluteDirection

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

Parameters:
relativeDir - One of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.
Returns:
The corresponding absolute direction, one of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, or AbsoluteCompass.TOP, AbsoluteCompass.BOTTOM.

getAbsoluteDirFromRelativeAxis

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

Parameters:
relativeAxis - One of RelativeAxis.BLOCK_PROGRESSION or RelativeAxis.INLINE_PROGRESSION.
Returns:
The corresponding absolute direction, one of AbsoluteDirection.TOP_TO_BOTTOM, AbsoluteDirection.BOTTOM_TO_TOP, AbsoluteDirection.LEFT_TO_RIGHT, or AbsoluteDirection.RIGHT_TO_LEFT, or -1 for invalid input or writing mode.

getRelativeDirection

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

Parameters:
absoluteDir - One of AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, or AbsoluteCompass.BOTTOM.
Returns:
The corresponding relative direction, one of RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER.

getCorresponding

Compass getCorresponding(Compass 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 (RelativeCompass.START, RelativeCompass.END, RelativeCompass.BEFORE, or RelativeCompass.AFTER), or an absolute direction constant (AbsoluteCompass.LEFT, AbsoluteCompass.RIGHT, AbsoluteCompass.TOP, AbsoluteCompass.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.2

This documentation was created August 8 2007 by The aXSL Group and may be freely copied. See license for details.