Java Doc for BidiOrder.java in  » PDF » pdf-itext » com » lowagie » text » pdf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lowagie.text.pdf.BidiOrder

BidiOrder
final public class BidiOrder (Code)
Reference implementation of the Unicode 3.0 Bidi algorithm.

This implementation is not optimized for performance. It is intended as a reference implementation that closely follows the specification of the Bidirectional Algorithm in The Unicode Standard version 3.0.

Input:
There are two levels of input to the algorithm, since clients may prefer to supply some information from out-of-band sources rather than relying on the default behavior.

  1. unicode type array
  2. unicode type array, with externally supplied base line direction

Output:
Output is separated into several stages as well, to better enable clients to evaluate various aspects of implementation conformance.

  1. levels array over entire paragraph
  2. reordering array over entire paragraph
  3. levels array over line
  4. reordering array over line
Note that for conformance, algorithms are only required to generate correct reordering and character directionality (odd or even levels) over a line. Generating identical level arrays over a line is not required. Bidi explicit format codes (LRE, RLE, LRO, RLO, PDF) and BN can be assigned arbitrary levels and positions as long as the other text matches.

As the algorithm is defined to operate on a single paragraph at a time, this implementation is written to handle single paragraphs. Thus rule P1 is presumed by this implementation-- the data provided to the implementation is assumed to be a single paragraph, and either contains no 'B' codes, or a single 'B' code at the end of the input. 'B' is allowed as input to illustrate how the algorithm assigns it a level.

Also note that rules L3 and L4 depend on the rendering engine that uses the result of the bidi algorithm. This implementation assumes that the rendering engine expects combining marks in visual order (e.g. to the left of their base character in RTL runs) and that it adjust the glyphs used to render mirrored characters that are in RTL runs so that they render appropriately.
author:
   Doug Felt



Field Summary
final public static  byteAL
    
final public static  byteAN
    
final public static  byteB
    
final public static  byteBN
    
final public static  byteCS
    
final public static  byteEN
    
final public static  byteES
    
final public static  byteET
    
final public static  byteL
    
final public static  byteLRE
    
final public static  byteLRO
    
final public static  byteNSM
    
final public static  byteON
    
final public static  bytePDF
    
final public static  byteR
    
final public static  byteRLE
    
final public static  byteRLO
    
final public static  byteS
    
final public static  byteTYPE_MAX
     Maximum bidi type value.
final public static  byteTYPE_MIN
     Minimum bidi type value.
final public static  byteWS
    

Constructor Summary
public  BidiOrder(byte[] types)
     Initialize using an array of direction types.
public  BidiOrder(byte[] types, byte paragraphEmbeddingLevel)
     Initialize using an array of direction types and an externally supplied paragraph embedding level. The embedding level may be -1, 0, or 1.
public  BidiOrder(char text, int offset, int length, byte paragraphEmbeddingLevel)
    

Method Summary
public  bytegetBaseLevel()
     Return the base level of the paragraph.
final public static  bytegetDirection(char c)
    
public  byte[]getLevels()
    
public  byte[]getLevels(int[] linebreaks)
     Return levels array breaking lines at offsets in linebreaks.
public  int[]getReordering(int[] linebreaks)
     Return reordering array breaking lines at offsets in linebreaks.

The reordering array maps from a visual index to a logical index. Lines are concatenated from left to right.


Field Detail
AL
final public static byte AL(Code)
Right-to-Left Arabic



AN
final public static byte AN(Code)
Arabic Number



B
final public static byte B(Code)
Paragraph Separator



BN
final public static byte BN(Code)
Boundary Neutral



CS
final public static byte CS(Code)
Common Number Separator



EN
final public static byte EN(Code)
European Number



ES
final public static byte ES(Code)
European Number Separator



ET
final public static byte ET(Code)
European Number Terminator



L
final public static byte L(Code)
Left-to-right



LRE
final public static byte LRE(Code)
Left-to-Right Embedding



LRO
final public static byte LRO(Code)
Left-to-Right Override



NSM
final public static byte NSM(Code)
Non-Spacing Mark



ON
final public static byte ON(Code)
Other Neutrals



PDF
final public static byte PDF(Code)
Pop Directional Format



R
final public static byte R(Code)
Right-to-Left



RLE
final public static byte RLE(Code)
Right-to-Left Embedding



RLO
final public static byte RLO(Code)
Right-to-Left Override



S
final public static byte S(Code)
Segment Separator



TYPE_MAX
final public static byte TYPE_MAX(Code)
Maximum bidi type value.



TYPE_MIN
final public static byte TYPE_MIN(Code)
Minimum bidi type value.



WS
final public static byte WS(Code)
Whitespace




Constructor Detail
BidiOrder
public BidiOrder(byte[] types)(Code)
Initialize using an array of direction types. Types range from TYPE_MIN to TYPE_MAX inclusive and represent the direction codes of the characters in the text.
Parameters:
  types - the types array



BidiOrder
public BidiOrder(byte[] types, byte paragraphEmbeddingLevel)(Code)
Initialize using an array of direction types and an externally supplied paragraph embedding level. The embedding level may be -1, 0, or 1. -1 means to apply the default algorithm (rules P2 and P3), 0 is for LTR paragraphs, and 1 is for RTL paragraphs.
Parameters:
  types - the types array
Parameters:
  paragraphEmbeddingLevel - the externally supplied paragraph embedding level.



BidiOrder
public BidiOrder(char text, int offset, int length, byte paragraphEmbeddingLevel)(Code)




Method Detail
getBaseLevel
public byte getBaseLevel()(Code)
Return the base level of the paragraph.



getDirection
final public static byte getDirection(char c)(Code)



getLevels
public byte[] getLevels()(Code)



getLevels
public byte[] getLevels(int[] linebreaks)(Code)
Return levels array breaking lines at offsets in linebreaks.
Rule L1.

The returned levels array contains the resolved level for each bidi code passed to the constructor.

The linebreaks array must include at least one value. The values must be in strictly increasing order (no duplicates) between 1 and the length of the text, inclusive. The last value must be the length of the text.
Parameters:
  linebreaks - the offsets at which to break the paragraph the resolved levels of the text




getReordering
public int[] getReordering(int[] linebreaks)(Code)
Return reordering array breaking lines at offsets in linebreaks.

The reordering array maps from a visual index to a logical index. Lines are concatenated from left to right. So for example, the fifth character from the left on the third line is

 getReordering(linebreaks)[linebreaks[1] + 4]
(linebreaks[1] is the position after the last character of the second line, which is also the index of the first character on the third line, and adding four gets the fifth character from the left).

The linebreaks array must include at least one value. The values must be in strictly increasing order (no duplicates) between 1 and the length of the text, inclusive. The last value must be the length of the text.
Parameters:
  linebreaks - the offsets at which to break the paragraph.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.