Java Doc for TextRunBreaker.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » awt » gl » font » 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 » Apache Harmony Java SE » org package » org.apache.harmony.awt.gl.font 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.harmony.awt.gl.font.TextRunBreaker

TextRunBreaker
public class TextRunBreaker implements Cloneable(Code)
This class is responsible for breaking the text into the run segments with constant font, style, other text attributes and direction. It also stores the created text run segments and covers functionality related to the operations on the set of segments, like calculating metrics, rendering, justification, hit testing, etc.

Inner Class :class JustificationInfo

Field Summary
 AttributedCharacterIteratoraci
    
 HashMap<Integer, Decoration>decorations
    
 HashMap<Integer, Object>fonts
    
 intforcedFontRunStarts
    
 FontRenderContextfrc
    
 floatjustification
    
 byte[]levels
    
 intlogical2segment
    
 intlogical2visual
    
 ArrayList<TextRunSegment>runSegments
    
 intsegment2visual
    
 intsegmentsStartsegmentsEnd
    
 SegmentsInfostoredSegments
    
 char[]text
    
 intvisual2logical
    
 intvisual2segment
    

Constructor Summary
public  TextRunBreaker(AttributedCharacterIterator aci, FontRenderContext frc)
    

Method Summary
public  Objectclone()
    
public  voidcreateAllSegments()
     Checks if text run segments are up to date and creates the new segments if not.
public  voidcreateSegments(int runStart, int runEnd)
    
 voidcreateStyleRuns()
     Breaks the text into separate style runs.
public  voiddeleteChar(AttributedCharacterIterator newParagraph, int deletePos)
     Deletes character from the managed text.
public  voiddrawSegments(Graphics2D g2d, float xOffset, float yOffset)
    
public  booleanequals(Object obj)
    
public  AttributedCharacterIteratorgetACI()
    
public  intgetBaseLevel()
    
public  ShapegetBlackBoxBounds(int firstEndpoint, int secondEndpoint)
    
public  chargetChar(int index)
    
public  intgetCharCount()
    
public  floatgetJustification()
    
public  intgetLastNonWhitespace()
     Calculates position of the last non whitespace character in the managed text.
public  bytegetLevel(int idx)
    
 intgetLevelRunLimit(int runStart, int runEnd)
     Calculates the end index of the level run, limited by the given text run.
public  intgetLineBreakIndex(int start, float maxAdvance)
     Calculates position where line should be broken without taking into account word boundaries.
public  Rectangle2DgetLogicalBounds()
    
 intgetLogicalFromVisual(int visual)
     Visual order of the characters may differ from the logical order.
public  GeneralPathgetOutline()
    
 intgetSegmentFromVisualOrder(int visual)
     Visual order of text segments may differ from the logical order.
 intgetStyleRunLimit(int runStart, int maxPos)
     Starting from the current position looks for the end of the text run with constant text attributes.
public  Rectangle2DgetVisualBounds()
    
 intgetVisualFromLogical(int logical)
     Visual order of the characters may differ from the logical order.
 intgetVisualFromSegmentOrder(int segmentNum)
     Visual order of text segments may differ from the logical order.
public  inthashCode()
    
public  TextHitInfohitTest(float x, float y)
     Calculates text hit info from the screen coordinates.
public  voidinsertChar(AttributedCharacterIterator newParagraph, int insertPos)
     Inserts character into the managed text.
public  booleanisLTR()
    
public  voidjustify(float gap)
     Performs justification of the managed text by changing segment positions and positions of the glyphs inside of the segments.
public  voidpopSegments()
    
public  voidpushSegments(int newSegStart, int newSegEnd)
    
 Map<? extends Attribute, ?>unpackAttributes(Map<? extends Attribute, ?> attrs)
    

Field Detail
aci
AttributedCharacterIterator aci(Code)



decorations
HashMap<Integer, Decoration> decorations(Code)



fonts
HashMap<Integer, Object> fonts(Code)



forcedFontRunStarts
int forcedFontRunStarts(Code)



frc
FontRenderContext frc(Code)



justification
float justification(Code)



levels
byte[] levels(Code)



logical2segment
int logical2segment(Code)



logical2visual
int logical2visual(Code)



runSegments
ArrayList<TextRunSegment> runSegments(Code)



segment2visual
int segment2visual(Code)



segmentsStartsegmentsEnd
int segmentsStartsegmentsEnd(Code)



storedSegments
SegmentsInfo storedSegments(Code)



text
char[] text(Code)



visual2logical
int visual2logical(Code)



visual2segment
int visual2segment(Code)




Constructor Detail
TextRunBreaker
public TextRunBreaker(AttributedCharacterIterator aci, FontRenderContext frc)(Code)




Method Detail
clone
public Object clone()(Code)



createAllSegments
public void createAllSegments()(Code)
Checks if text run segments are up to date and creates the new segments if not.



createSegments
public void createSegments(int runStart, int runEnd)(Code)
Creates segments for the text run with constant decoration, font and bidi level
Parameters:
  runStart - - run start
Parameters:
  runEnd - - run end



createStyleRuns
void createStyleRuns()(Code)
Breaks the text into separate style runs.



deleteChar
public void deleteChar(AttributedCharacterIterator newParagraph, int deletePos)(Code)
Deletes character from the managed text.
Parameters:
  newParagraph - - new character iterator
Parameters:
  deletePos - - deletion position



drawSegments
public void drawSegments(Graphics2D g2d, float xOffset, float yOffset)(Code)
Renders the managed text
Parameters:
  g2d - - graphics where to render
Parameters:
  xOffset - - offset in X direction to the upper left cornerof the layout from the origin of the graphics
Parameters:
  yOffset - - offset in Y direction to the upper left cornerof the layout from the origin of the graphics



equals
public boolean equals(Object obj)(Code)



getACI
public AttributedCharacterIterator getACI()(Code)



getBaseLevel
public int getBaseLevel()(Code)



getBlackBoxBounds
public Shape getBlackBoxBounds(int firstEndpoint, int secondEndpoint)(Code)
Creates the black box bounds shape
Parameters:
  firstEndpoint - - start position
Parameters:
  secondEndpoint - - end position black box bounds shape



getChar
public char getChar(int index)(Code)



getCharCount
public int getCharCount()(Code)



getJustification
public float getJustification()(Code)



getLastNonWhitespace
public int getLastNonWhitespace()(Code)
Calculates position of the last non whitespace character in the managed text. position of the last non whitespace character



getLevel
public byte getLevel(int idx)(Code)



getLevelRunLimit
int getLevelRunLimit(int runStart, int runEnd)(Code)
Calculates the end index of the level run, limited by the given text run.
Parameters:
  runStart - - run start
Parameters:
  runEnd - - run end end index of the level run



getLineBreakIndex
public int getLineBreakIndex(int start, float maxAdvance)(Code)
Calculates position where line should be broken without taking into account word boundaries.
Parameters:
  start - - start index
Parameters:
  maxAdvance - - maximum advance, width of the line position where to break



getLogicalBounds
public Rectangle2D getLogicalBounds()(Code)
Creates logical bounds shape logical bounds rectangle



getLogicalFromVisual
int getLogicalFromVisual(int visual)(Code)
Visual order of the characters may differ from the logical order. This method calculates logical position of the character from its visual position.
Parameters:
  visual - - visual position logical position



getOutline
public GeneralPath getOutline()(Code)
Creates outline shape for the managed text outline



getSegmentFromVisualOrder
int getSegmentFromVisualOrder(int visual)(Code)
Visual order of text segments may differ from the logical order. This method calculates logical position of the segment from its visual position.
Parameters:
  visual - - visual position of the segment logical position of the segment



getStyleRunLimit
int getStyleRunLimit(int runStart, int maxPos)(Code)
Starting from the current position looks for the end of the text run with constant text attributes.
Parameters:
  runStart - - start position
Parameters:
  maxPos - - position where to stop if no run limit found style run limit



getVisualBounds
public Rectangle2D getVisualBounds()(Code)
Creates visual bounds shape visual bounds rectangle



getVisualFromLogical
int getVisualFromLogical(int logical)(Code)
Visual order of the characters may differ from the logical order. This method calculates visual position of the character from its logical position.
Parameters:
  logical - - logical position of the character visual position



getVisualFromSegmentOrder
int getVisualFromSegmentOrder(int segmentNum)(Code)
Visual order of text segments may differ from the logical order. This method calculates visual position of the segment from its logical position.
Parameters:
  segmentNum - - logical position of the segment visual position of the segment



hashCode
public int hashCode()(Code)



hitTest
public TextHitInfo hitTest(float x, float y)(Code)
Calculates text hit info from the screen coordinates. Current implementation totally ignores Y coordinate. If X coordinate is outside of the layout boundaries, this method returns leftmost or rightmost hit.
Parameters:
  x - - x coordinate of the hit
Parameters:
  y - - y coordinate of the hit hit info



insertChar
public void insertChar(AttributedCharacterIterator newParagraph, int insertPos)(Code)
Inserts character into the managed text.
Parameters:
  newParagraph - - new character iterator
Parameters:
  insertPos - - insertion position



isLTR
public boolean isLTR()(Code)



justify
public void justify(float gap)(Code)
Performs justification of the managed text by changing segment positions and positions of the glyphs inside of the segments.
Parameters:
  gap - - amount of space which should be compensated by justification



popSegments
public void popSegments()(Code)
Restores the internal state of the class



pushSegments
public void pushSegments(int newSegStart, int newSegEnd)(Code)
Saves the internal state of the class
Parameters:
  newSegStart - - new start index in the text
Parameters:
  newSegEnd - - new end index in the text



unpackAttributes
Map<? extends Attribute, ?> unpackAttributes(Map<? extends Attribute, ?> attrs)(Code)
Adds InputMethodHighlight to the attributes
Parameters:
  attrs - - text attributes patched text attributes



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.