Java Doc for Paragraph.java in  » Portal » Open-Portal » ob » text » 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 » Portal » Open Portal » ob.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ob.text.Paragraph

Paragraph
public class Paragraph extends Object implements Serializable(Code)


Field Summary
final public static  intCENTER
    
final protected static  intCOMPLETE
    
final public static  intLEFT
    
final protected static  intNONE
    
final protected static  intPARTIAL
    
final public static  intRIGHT
    
 StringBufferbuffer
    
 intcursorPoscurrentLine
    
 FontMetricsfontMetrics
    
 intleftOffset
    
 Vectorlines
    
 booleanm_bMarkVisible
    
 booleanm_bVisible
    
 Colorm_cBackground
    
 Colorm_cForeground
    
 Colorm_cHighlight
    
 Colorm_cTextHighlight
    
 Fontm_fFont
    
 Insetsm_inInsets
    
 intm_nHAlign
    
 intm_nWidth
    
 intm_nYSpanm_nFirstLine
    
 intselected
    
 intselectionStartselectionEnd
    
 IScrollabletarget
    

Constructor Summary
public  Paragraph()
    
public  Paragraph(String s)
     Constructor that sets up the preliminary data.
public  Paragraph(IScrollable target)
     Constructor that takes the text control as an argument.
public  Paragraph(IScrollable target, String s)
     This constructor takes the text control as well as the initial string.

Method Summary
public  voidaddNotify()
    
public  ColorgetBackground()
    
protected  PointgetCursorPoint()
     This returns the cursor's x/y location in Point format.
protected  intgetCursorPos()
    
public  intgetCursorPosFromPoint(Point p)
     This returns the cursor's position from a Point.
protected  intgetFirstLine()
    
public  FontgetFont()
     This returns the font of the Paragraph.
public  FontMetricsgetFontMetrics()
     This returns the FontMetrics of the Paragraph.
public  ColorgetForeground()
     This returns the foreground of the Paragraph.
protected  ColorgetHighlight()
     This returns the color of the highlight.
protected  ColorgetHighlightedText()
     This returns the color of the highlighted text.
public  InsetsgetInsets()
     This returns the insets of the Paragraph.
protected  VectorgetLines()
     This returns the lines of the Paragraph.
protected  booleangetMarkVisible()
     This returns whether or not the mark (selection) is visible.
protected  intgetPositionAt(String s, int len)
     This takes the string and returns the cursor position given the length in pixels.
protected  intgetPrevXOffset()
     This returns the previous x offset.
protected  intgetSelectionEnd()
     This returns the end of the selection.
protected  intgetSelectionStart()
     This returns the start of the selection.
protected  intgetSelectionState()
     This returns the selection state.
public  IScrollablegetTarget()
     This returns the text control.
protected  StringgetText()
     This returns the text of the Paragraph.
public  intgetWidth()
     This returns the width of the Paragraph in pixels.
protected  intgetXCoord()
     This returns the cursor position.
protected  intgetXOffset()
     This returns the x offset.
protected  intgetYSpan()
     This returns the height of the Paragraph.
protected  booleaninsertChar(char c, boolean watchWidth)
     This inserts a character into the Paragraph.
protected  booleanisAllowScroll()
     This returns whether or not the Paragraph class allows scrolling.
public  booleanisAutoWrap()
     This returns whether or not the Paragraph class allows auto-wrapping behavior.
protected  booleanisCursorAtEnd()
     This returns whether or not the cursor position is at the end.
protected  booleanisCursorOnFirstLine()
     This returns whether or not the cursor is on the first line of the text control.
protected  booleanisCursorOnLastLine()
     This returns whether or not the cursor is on the last line of the text control.
protected  booleanisVisible()
     This returns whether or not the Paragraph class is visible.
protected  voidmoveSpecial(boolean b, int w, int key)
     This moves the cursor within the text control.
protected  voidonBackspaceKey()
     This is called whenever the user hits the 'Backspace' key.
protected  voidonDeleteKey()
     This is called whenever the user hits the 'Delete' key.
protected  voidonDownKey()
     This is called whenever the user hits the down arrow key in a MultiText control and the new cursor position has to be figured.
protected  voidonEndKey()
     This is called from the MultiText class when the 'End' key was pressed and the new cursor position has to be figured out.
protected  StringonEnterKey()
     This is called from the MultiText class to determine whether the 'Enter' key was pressed in the middle of a Paragraph.
protected  voidonHomeKey()
     This is called from the MultiText class whenever the 'Home' key is pressed and the new cursor position has to be figured out.
protected  voidonScrollAction()
     This is called whenever horizontal scrolling has to be figured out.
protected  voidonTextModified()
     This is called whenever there's a text modification.
protected  voidonUpKey()
     This is called from the MultiText class whenever the user hits the up arrow key and the new cursor position has to be figured out.
protected  voidrender(Graphics g, int x, int y, boolean underline, boolean xo)
     This draws the Paragraph class given the arguments.
protected  voidsetAllowScroll(boolean b)
     This sets the scrolling behavior of the Paragraph class.
public  voidsetAutoWrap(boolean bWrap)
     This sets whether or not the Paragraph class will autowrap.
public  voidsetBackground(Color c)
     This sets the background of the Paragraph.
protected  voidsetCursorPos(int p)
     This sets the cursor position of the Paragraph.
public  voidsetFont(Font f)
     This sets the font of the Paragraph.
public  voidsetFontMetrics(FontMetrics fm)
     This sets the FontMetrics of the Paragraph.
public  voidsetForeground(Color c)
     This sets the foreground color of the Paragraph.
protected  voidsetHAlign(int align)
     This sets the horizontal alignment of the Paragraph.
protected  voidsetHighlight(Color c)
     This sets the highlighting color.
protected  voidsetHighlightedText(Color c)
     This sets the color of the highlighted text.
public  voidsetInsets(Insets i)
     This sets the insets of the text control.
protected  voidsetMarkVisible(boolean b)
     This sets whether or not the selection mark is visible.
protected  voidsetPrevXOffset(int x)
     This sets the previous x offset.
protected  voidsetSelectionEnd(int pos)
     This sets the selection end of the Paragraph.
protected  voidsetSelectionStart(int pos)
     This sets the start of the Paragraph's selection.
protected  voidsetSelectionState(int s)
     This sets the selection state of the Paragraph.
public  voidsetTarget(IScrollable target)
     This sets the text control as the target.
protected  voidsetText(String s)
     This sets the text of the Paragraph.
public  voidsetWidth(int w)
     This sets the width of the Paragraph in pixels.
protected  voidsetXOffset(int x)
     This sets the x offset of the Paragraph.
public  StringtoString()
     This overrides Object's toString() to represent the Paragraph in String format.

Field Detail
CENTER
final public static int CENTER(Code)



COMPLETE
final protected static int COMPLETE(Code)



LEFT
final public static int LEFT(Code)



NONE
final protected static int NONE(Code)



PARTIAL
final protected static int PARTIAL(Code)



RIGHT
final public static int RIGHT(Code)



buffer
StringBuffer buffer(Code)



cursorPoscurrentLine
int cursorPoscurrentLine(Code)



fontMetrics
FontMetrics fontMetrics(Code)



leftOffset
int leftOffset(Code)



lines
Vector lines(Code)



m_bMarkVisible
boolean m_bMarkVisible(Code)



m_bVisible
boolean m_bVisible(Code)



m_cBackground
Color m_cBackground(Code)



m_cForeground
Color m_cForeground(Code)



m_cHighlight
Color m_cHighlight(Code)



m_cTextHighlight
Color m_cTextHighlight(Code)



m_fFont
Font m_fFont(Code)



m_inInsets
Insets m_inInsets(Code)



m_nHAlign
int m_nHAlign(Code)



m_nWidth
int m_nWidth(Code)



m_nYSpanm_nFirstLine
int m_nYSpanm_nFirstLine(Code)



selected
int selected(Code)



selectionStartselectionEnd
int selectionStartselectionEnd(Code)



target
IScrollable target(Code)




Constructor Detail
Paragraph
public Paragraph()(Code)
Null constructor that just forwards to the constructor w/ the String argument



Paragraph
public Paragraph(String s)(Code)
Constructor that sets up the preliminary data.
Parameters:
  s - - initial text of the Paragraph



Paragraph
public Paragraph(IScrollable target)(Code)
Constructor that takes the text control as an argument.
Parameters:
  text - control that interfaces IScrollable



Paragraph
public Paragraph(IScrollable target, String s)(Code)
This constructor takes the text control as well as the initial string.
Parameters:
  target - - text control that interfaces w/ IScrollable
Parameters:
  s - - initial string




Method Detail
addNotify
public void addNotify()(Code)
This is overridden to call onTextModified



getBackground
public Color getBackground()(Code)
This returns the color of the background background color



getCursorPoint
protected Point getCursorPoint()(Code)
This returns the cursor's x/y location in Point format. cursor's location



getCursorPos
protected int getCursorPos()(Code)
This returns the cursor's position cursor's position



getCursorPosFromPoint
public int getCursorPosFromPoint(Point p)(Code)
This returns the cursor's position from a Point.
Parameters:
  p - - Point (x, y coordinates) cursor's position at that Point



getFirstLine
protected int getFirstLine()(Code)
This returns the first line of the Paragraph shown the index of the first line shown



getFont
public Font getFont()(Code)
This returns the font of the Paragraph. the font of the Paragraph



getFontMetrics
public FontMetrics getFontMetrics()(Code)
This returns the FontMetrics of the Paragraph. FontMetrics of the Paragraph



getForeground
public Color getForeground()(Code)
This returns the foreground of the Paragraph. foreground color



getHighlight
protected Color getHighlight()(Code)
This returns the color of the highlight. highlight color



getHighlightedText
protected Color getHighlightedText()(Code)
This returns the color of the highlighted text. highlighted text color



getInsets
public Insets getInsets()(Code)
This returns the insets of the Paragraph. insets of the Paragraph



getLines
protected Vector getLines()(Code)
This returns the lines of the Paragraph. the lines of the Paragraph



getMarkVisible
protected boolean getMarkVisible()(Code)
This returns whether or not the mark (selection) is visible. mark visibility



getPositionAt
protected int getPositionAt(String s, int len)(Code)
This takes the string and returns the cursor position given the length in pixels.
Parameters:
  s - - string to measure on
Parameters:
  len - - length to span in pixels cursor position



getPrevXOffset
protected int getPrevXOffset()(Code)
This returns the previous x offset. previous x offset



getSelectionEnd
protected int getSelectionEnd()(Code)
This returns the end of the selection. end of the selection



getSelectionStart
protected int getSelectionStart()(Code)
This returns the start of the selection. start of the selection



getSelectionState
protected int getSelectionState()(Code)
This returns the selection state. selection state



getTarget
public IScrollable getTarget()(Code)
This returns the text control. text control



getText
protected String getText()(Code)
This returns the text of the Paragraph. text



getWidth
public int getWidth()(Code)
This returns the width of the Paragraph in pixels. width of Paragraph



getXCoord
protected int getXCoord()(Code)
This returns the cursor position. cursor position
See Also:   Paragraph.getCursorPos



getXOffset
protected int getXOffset()(Code)
This returns the x offset. x offset



getYSpan
protected int getYSpan()(Code)
This returns the height of the Paragraph. height of Paragraph



insertChar
protected boolean insertChar(char c, boolean watchWidth)(Code)
This inserts a character into the Paragraph.
Parameters:
  c - - character to insert
Parameters:
  watchWidth - - whether to check to see if it fits first whether or not the insertion was successful



isAllowScroll
protected boolean isAllowScroll()(Code)
This returns whether or not the Paragraph class allows scrolling. scrolling behavior flag



isAutoWrap
public boolean isAutoWrap()(Code)
This returns whether or not the Paragraph class allows auto-wrapping behavior. auto-wrapping behavior flag



isCursorAtEnd
protected boolean isCursorAtEnd()(Code)
This returns whether or not the cursor position is at the end. if the cursor is at the end



isCursorOnFirstLine
protected boolean isCursorOnFirstLine()(Code)
This returns whether or not the cursor is on the first line of the text control. whether or not the cursor is one the first line



isCursorOnLastLine
protected boolean isCursorOnLastLine()(Code)
This returns whether or not the cursor is on the last line of the text control. whether or not the cursor is on the last line



isVisible
protected boolean isVisible()(Code)
This returns whether or not the Paragraph class is visible. Paragraph's visibility



moveSpecial
protected void moveSpecial(boolean b, int w, int key)(Code)
This moves the cursor within the text control. Called from up/down arrow keys.
Parameters:
  b - - if true, go to the last line
Parameters:
  w - - width (in pixels) to move to
Parameters:
  key - - which key was pressed.



onBackspaceKey
protected void onBackspaceKey()(Code)
This is called whenever the user hits the 'Backspace' key.



onDeleteKey
protected void onDeleteKey()(Code)
This is called whenever the user hits the 'Delete' key.



onDownKey
protected void onDownKey()(Code)
This is called whenever the user hits the down arrow key in a MultiText control and the new cursor position has to be figured.



onEndKey
protected void onEndKey()(Code)
This is called from the MultiText class when the 'End' key was pressed and the new cursor position has to be figured out.



onEnterKey
protected String onEnterKey()(Code)
This is called from the MultiText class to determine whether the 'Enter' key was pressed in the middle of a Paragraph. string after the cursor position (null if none)



onHomeKey
protected void onHomeKey()(Code)
This is called from the MultiText class whenever the 'Home' key is pressed and the new cursor position has to be figured out.



onScrollAction
protected void onScrollAction()(Code)
This is called whenever horizontal scrolling has to be figured out.



onTextModified
protected void onTextModified()(Code)
This is called whenever there's a text modification.



onUpKey
protected void onUpKey()(Code)
This is called from the MultiText class whenever the user hits the up arrow key and the new cursor position has to be figured out.



render
protected void render(Graphics g, int x, int y, boolean underline, boolean xo)(Code)
This draws the Paragraph class given the arguments.
Parameters:
  g - - the Graphics class to draw upon
Parameters:
  x - - the x coordinate
Parameters:
  y - - the y coordinate
Parameters:
  underline - - whether to draw an underline or not
Parameters:
  xo - - whether to draw the strikeout or not



setAllowScroll
protected void setAllowScroll(boolean b)(Code)
This sets the scrolling behavior of the Paragraph class.
Parameters:
  b - - scrolling behavior flag



setAutoWrap
public void setAutoWrap(boolean bWrap)(Code)
This sets whether or not the Paragraph class will autowrap.
Parameters:
  bWrap - - autowrap boolean flag



setBackground
public void setBackground(Color c)(Code)
This sets the background of the Paragraph.
Parameters:
  c - - background color



setCursorPos
protected void setCursorPos(int p)(Code)
This sets the cursor position of the Paragraph.
Parameters:
  p - - cursor position



setFont
public void setFont(Font f)(Code)
This sets the font of the Paragraph.
Parameters:
  f - - the new Font



setFontMetrics
public void setFontMetrics(FontMetrics fm)(Code)
This sets the FontMetrics of the Paragraph.
Parameters:
  fm - - the new FontMetrics



setForeground
public void setForeground(Color c)(Code)
This sets the foreground color of the Paragraph.
Parameters:
  c - - the new Foreground



setHAlign
protected void setHAlign(int align)(Code)
This sets the horizontal alignment of the Paragraph.
Parameters:
  align - - horizontal alignment



setHighlight
protected void setHighlight(Color c)(Code)
This sets the highlighting color.
Parameters:
  c - - highlighting color



setHighlightedText
protected void setHighlightedText(Color c)(Code)
This sets the color of the highlighted text.
Parameters:
  c - - highlighted text color



setInsets
public void setInsets(Insets i)(Code)
This sets the insets of the text control.
Parameters:
  i - - insets



setMarkVisible
protected void setMarkVisible(boolean b)(Code)
This sets whether or not the selection mark is visible.
Parameters:
  b - - mark visibility flag



setPrevXOffset
protected void setPrevXOffset(int x)(Code)
This sets the previous x offset.
Parameters:
  x - - previous x offset



setSelectionEnd
protected void setSelectionEnd(int pos)(Code)
This sets the selection end of the Paragraph.
Parameters:
  pos - - position of the selection end



setSelectionStart
protected void setSelectionStart(int pos)(Code)
This sets the start of the Paragraph's selection.
Parameters:
  pos - - position of the start of the selection



setSelectionState
protected void setSelectionState(int s)(Code)
This sets the selection state of the Paragraph.
Parameters:
  s - - one of these: (Paragraph.NONE||Paragraph.PARTIAL||Paragraph.COMPLETE)



setTarget
public void setTarget(IScrollable target)(Code)
This sets the text control as the target.
Parameters:
  target - - the text control that implements IScrollable



setText
protected void setText(String s)(Code)
This sets the text of the Paragraph.
Parameters:
  s - - text



setWidth
public void setWidth(int w)(Code)
This sets the width of the Paragraph in pixels.
Parameters:
  w - - new width of the Paragraph



setXOffset
protected void setXOffset(int x)(Code)
This sets the x offset of the Paragraph.
Parameters:
  x - - x offset



toString
public String toString()(Code)
This overrides Object's toString() to represent the Paragraph in String format. a string representation of 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.