Java Doc for StyleBuffer.java in  » Internationalization-Localization » icu4j » com » ibm » richtext » styledtext » 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 » Internationalization Localization » icu4j » com.ibm.richtext.styledtext 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.richtext.styledtext.MStyleBuffer
      com.ibm.richtext.styledtext.StyleBuffer

StyleBuffer
final class StyleBuffer extends MStyleBuffer implements Externalizable(Code)
StyleBuffer implements MStyleBuffer. It maintains AttributeMap objects to apply to the text in an MText object, and the intervals on which those styles apply.

StyleBuffer stores the intervals on which styles apply in a RunArray object (see RunArray for more information). The styles are stored in an array of AttributeMap objects.

RunArray maintains an array of integers which represent offsets into text. The array has a "positive" region in which offsets are given as positive distances from the start of the text, and a "negative" region in which offsets are given as negative distances from the end of the text. Between the positive and negative regions is a gap, into which new offsets may be inserted. This storage scheme allows for efficient response to a series of editing operations which occur in the same area of the text.

StyleBuffer uses the offsets in RunArray as the boundaries of style runs. A style run begins at each offset in RunArray, and each style run continues to the next offset. The style array is kept in sync with the array of offsets in RunArray; that is, the style which begins at RunArray[i] is stored in StyleArray[i].

The first entry in the RunArray is always 0.
author:
   John Raley
See Also:   AttributeMap
See Also:   MText
See Also:   RunArray



Field Summary
final static  StringCOPYRIGHT
    

Constructor Summary
 StyleBuffer(MConstText text, AttributeMap initialStyle)
    
 StyleBuffer(int initialLength, AttributeMap initialStyle)
     Creates a new style buffer with length initialLength and with a single run of defaultStyle.
public  StyleBuffer()
     Note: this constructor is ONLY for use by the Serialization mechanism.

Method Summary
 voidcompress()
     Minimize the amount of storage used by this object.
public  voiddeleteText(int start, int limit)
     Respond to a deletion in the text.
public  voidinsertText(int start, int limit)
     Respond to an insertion in the text.
public  booleanmodifyStyles(int start, int limit, StyleModifier modifier, int[] damagedRange)
    
public  voidreadExternal(ObjectInput in)
    
public  voidreplace(int start, int limit, MConstText srcText, int srcStart, int srcLimit)
    
 voidsetIterator(int pos, StyleRunIterator iter)
    
public  AttributeMapstyleAt(int pos)
     Return style at location pos.
public  intstyleLimit(int pos)
    
public  intstyleStart(int pos)
    
public  voidwriteExternal(ObjectOutput out)
    

Field Detail
COPYRIGHT
final static String COPYRIGHT(Code)




Constructor Detail
StyleBuffer
StyleBuffer(MConstText text, AttributeMap initialStyle)(Code)



StyleBuffer
StyleBuffer(int initialLength, AttributeMap initialStyle)(Code)
Creates a new style buffer with length initialLength and with a single run of defaultStyle.



StyleBuffer
public StyleBuffer()(Code)
Note: this constructor is ONLY for use by the Serialization mechanism. It does not leave this object in a valid state!




Method Detail
compress
void compress()(Code)
Minimize the amount of storage used by this object.



deleteText
public void deleteText(int start, int limit)(Code)
Respond to a deletion in the text. The last style run before start is truncated to end at start. The style run containing (start+length) is set to begin at (start+length). Runs in between are deleted. If the deletion occurs entirely within one style run, the length of the style run is reduced by length. This implementation assumes that all styles propogate. This method shifts the run table such that the run in which the delete began is the last positive run. Other methods depend on this "side effect".
Parameters:
  start - the offset where the deletion began
Parameters:
  length - the offset where the deletion stopped



insertText
public void insertText(int start, int limit)(Code)
Respond to an insertion in the text. The length of the last style run which begins before start is increased by length. The run table is shifted such that the run into which text was inserted is the last positive run. This implementation assumes that all styles propogate.
Parameters:
  start - the offset where the insertion began
Parameters:
  length - the number of characters inserted



modifyStyles
public boolean modifyStyles(int start, int limit, StyleModifier modifier, int[] damagedRange)(Code)



readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException(Code)



replace
public void replace(int start, int limit, MConstText srcText, int srcStart, int srcLimit)(Code)



setIterator
void setIterator(int pos, StyleRunIterator iter)(Code)



styleAt
public AttributeMap styleAt(int pos)(Code)
Return style at location pos.
Parameters:
  pos - an offset into the text



styleLimit
public int styleLimit(int pos)(Code)



styleStart
public int styleStart(int pos)(Code)



writeExternal
public void writeExternal(ObjectOutput out) throws IOException(Code)



Fields inherited from com.ibm.richtext.styledtext.MStyleBuffer
final static String COPYRIGHT(Code)(Java Doc)

Methods inherited from com.ibm.richtext.styledtext.MStyleBuffer
abstract void compress()(Code)(Java Doc)
abstract void deleteText(int start, int limit)(Code)(Java Doc)
abstract void insertText(int start, int limit)(Code)(Java Doc)
abstract boolean modifyStyles(int start, int limit, StyleModifier modifier, int[] damagedRange)(Code)(Java Doc)
abstract void replace(int start, int limit, MConstText srcText, int srcStart, int srcLimit)(Code)(Java Doc)
abstract AttributeMap styleAt(int pos)(Code)(Java Doc)
abstract int styleLimit(int pos)(Code)(Java Doc)
abstract int styleStart(int pos)(Code)(Java Doc)

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.