Java Doc for ReducedModelComment.java in  » IDE » DrJava » edu » rice » cs » drjava » model » definitions » reducedmodel » 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 » IDE » DrJava » edu.rice.cs.drjava.model.definitions.reducedmodel 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
      edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelComment

ReducedModelComment
public class ReducedModelComment extends AbstractReducedModel (Code)
Keeps track of newlines, comment blocks, and single and double-quoted strings. This reduced sub-model is used for coloring purposes. Given the information contained here, the DefinitionsEditorKit can paint strings, comments, and regular code in different colors. DefinitionsEditorKit colors keywords by directly reading DefinitionsDocument, the "full-scale" model.
version:
   $Id: ReducedModelComment.java 4255 2007-08-28 19:17:37Z mgricken $


Field Summary
 TokenList.Iterator_walker
    

Constructor Summary
public  ReducedModelComment()
     Constructor.

Method Summary
public  voiddelete(int count)
    
 voidgetDistToCurrentBraceNewline(IndentInfo braceInfo)
     Computes the distance to the beginning of the line containing the brace enclosing the current location.
 voidgetDistToIndentNewline(IndentInfo braceInfo)
    
public  intgetDistToNextNewline()
    
 voidgetDistToPreviousNewline(IndentInfo braceInfo)
     Dist to Previous newline will be -1 if no newline.
public  intgetDistToPreviousNewline(int relLoc)
     Gets distance to previous newline, relLoc is the distance back from the cursor that we want to start searching.
public  voidinsertChar(char ch)
    
protected  voidinsertGapBetweenMultiCharBrace(int length)
     Inserts a gap between the characters in a multiple character brace.
public  voidinsertNewline()
     Inserts an end-of-line character.
public  voidinsertQuote(String quote)
     Inserts the specified quote character.
public  voidmove(int count)
     Updates the BraceReduction to reflect cursor movement.
protected  ReducedModelStatemoveWalkerGetState(int relLocation)
    
protected  voidresetWalkerLocationToCursor()
    

Field Detail
_walker
TokenList.Iterator _walker(Code)
Can be used by other classes to walk through the list of comment chars




Constructor Detail
ReducedModelComment
public ReducedModelComment()(Code)
Constructor. Creates a new reduced model with the cursor at the start of a blank "page."




Method Detail
delete
public void delete(int count)(Code)

Update the BraceReduction to reflect text deletion.


Parameters:
  count - indicates the size and direction of text deletion.Negative values delete text to the left of the cursor, positive values delete text to the right.Always move count spaces to make sure we can delete.



getDistToCurrentBraceNewline
void getDistToCurrentBraceNewline(IndentInfo braceInfo)(Code)
Computes the distance to the beginning of the line containing the brace enclosing the current location. Stores this info in the IndentInfo field distToNewlineCurrent.



getDistToIndentNewline
void getDistToIndentNewline(IndentInfo braceInfo)(Code)



getDistToNextNewline
public int getDistToNextNewline()(Code)
Returns the distance to the gap before the next newline (end of document if no newline)



getDistToPreviousNewline
void getDistToPreviousNewline(IndentInfo braceInfo)(Code)
Dist to Previous newline will be -1 if no newline.



getDistToPreviousNewline
public int getDistToPreviousNewline(int relLoc)(Code)
Gets distance to previous newline, relLoc is the distance back from the cursor that we want to start searching.



insertChar
public void insertChar(char ch)(Code)



insertGapBetweenMultiCharBrace
protected void insertGapBetweenMultiCharBrace(int length)(Code)
Inserts a gap between the characters in a multiple character brace. This function is called by AbstractReducedModel's method insertGap when a Gap is inserted between the characters in a comment brace or an escape sequence. It splits up the multiple character brace into its component parts and inserts a Gap of size length in between the resulting split parts.
Parameters:
  length - the size of the Gap to be inserted in characters



insertNewline
public void insertNewline()(Code)
Inserts an end-of-line character.
  1. atStart: insert
  2. atEnd: insert
  3. inside multiple character brace:
    1. break current brace
    2. move next to make second part current
    3. insert brace between broken parts of former brace
    4. move previous twice to get before the broken first part
    5. walk
    6. move next twice to be after newline insertion
  4. inside a gap: use helper function
  5. otherwise, just insert normally



insertQuote
public void insertQuote(String quote)(Code)
Inserts the specified quote character.
  1. atStart: insert
  2. atEnd: insert
  3. inside multiple character brace:
    1. break current brace
    2. move next to make second part current
    3. insert brace between broken parts of former brace
    4. walk
    5. current = multiple char brace? move next once
      current = single char brace? move next twice
      We moved two previous, but if the broken part combined with the insert, there's only one brace where once were two.
    6. move next twice to be after newline insertion
  4. inside a gap: use helper function
  5. before a multiple char brace:
    1. break the current brace
    2. check previous and insert
  6. otherwise, just insert normally

Parameters:
  quote - the type of quote to insert



move
public void move(int count)(Code)
Updates the BraceReduction to reflect cursor movement. Negative values move left from the cursor, positive values move right.
Parameters:
  count - indicates the direction and magnitude of cursor movement



moveWalkerGetState
protected ReducedModelState moveWalkerGetState(int relLocation)(Code)
Returns the state at the relLocation, where relLocation is the location relative to the walker
Parameters:
  relLocation - distance from walker to get state at.



resetWalkerLocationToCursor
protected void resetWalkerLocationToCursor()(Code)
Resets the walker to the current position in document



Fields inherited from edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
final public static char PTR_CHAR(Code)(Java Doc)
TokenList.Iterator _cursor(Code)(Java Doc)
TokenList _tokens(Code)(Java Doc)

Methods inherited from edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
protected void _augmentCurrentGap(int length)(Code)(Java Doc)
protected void _augmentGapToLeft(int length)(Code)(Java Doc)
protected boolean _gapToLeft()(Code)(Java Doc)
protected boolean _gapToRight()(Code)(Java Doc)
public void _insertGap(int length)(Code)(Java Doc)
protected void _insertNewGap(int length)(Code)(Java Doc)
int absOffset()(Code)(Java Doc)
protected ReducedToken current()(Code)(Java Doc)
int getBlockOffset()(Code)(Java Doc)
protected ReducedModelState getStateAtCurrent()(Code)(Java Doc)
abstract public void insertChar(char ch)(Code)(Java Doc)
abstract protected void insertGapBetweenMultiCharBrace(int length)(Code)(Java Doc)
public TokenList.Iterator makeCopyCursor()(Code)(Java Doc)
abstract protected ReducedModelState moveWalkerGetState(int relLocation)(Code)(Java Doc)
protected void next()(Code)(Java Doc)
protected void prev()(Code)(Java Doc)
abstract protected void resetWalkerLocationToCursor()(Code)(Java Doc)
void setBlockOffset(int offset)(Code)(Java Doc)
public String simpleString()(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)

w__w__w.j___a___va_2__s.___co___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.