Java Doc for DrawGraphics.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » 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 » Swing Library » abeille forms designer » org.netbeans.editor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.editor.DrawGraphics

DrawGraphics
interface DrawGraphics (Code)
Draw graphics functions as abstraction over various kinds of drawing. It's used for drawing into classic graphics, printing and measuring. Generally there are only the setters for some properties because the draw-engine doesn't retrieve the values that it previously set.
author:
   Miloslav Metelka
version:
   1.00

Inner Class :abstract static class AbstractDG implements DrawGraphics
Inner Class :static class SimpleDG extends AbstractDG
Inner Class :final static class GraphicsDG extends SimpleDG
Inner Class :final static class PrintDG extends SimpleDG



Method Summary
public  voiddrawChars(int offset, int length, int width, Color strikeThroughColor, Color underlineColor)
     Draw characters from the specified offset in the buffer
Parameters:
  offset - offset in the buffer for drawn text; if the text containstabs, then offset is set to -1 and length contains the countof the space characters that correspond to the expanded tabs
Parameters:
  length - length of the text being drawn
Parameters:
  width - width of the text being drawn in points.
public  voiddrawTabs(int offset, int length, int spaceCount, int width, Color strikeThroughColor, Color underlineColor)
     Draw the expanded tab characters.
Parameters:
  offset - offset in the buffer where the tab characters start.
Parameters:
  length - number of the tab characters
Parameters:
  spaceCount - number of spaces that replace the tabs
Parameters:
  width - width of the spaces in points.
public  voideol()
     EOL encountered and should be handled.
public  voidfillRect(int width)
     Fill rectangle at the current [x, y] with the current background color.
Parameters:
  width - width of the rectangle to fill in points.
public  voidfinish()
     Called when whole drawing ends.
public  GraphicsgetGraphics()
     Get the AWT-graphics to determine whether this draws to a graphics.
public  voidinit(DrawContext ctx)
    
public  voidsetBackColor(Color backColor)
    
public  voidsetBuffer(char[] buffer)
     Set character buffer from which the characters are drawn.
public  voidsetDefaultBackColor(Color defaultBackColor)
     Inform the draw-graphics about the current background color of the component.
public  voidsetFont(Font font)
    
public  voidsetForeColor(Color foreColor)
    
public  voidsetLineAscent(int lineAscent)
     Set the ascent of the line.
public  voidsetLineHeight(int lineHeight)
     Set the height of the line.
public  voidsetX(int x)
    
public  voidsetY(int y)
    
public  booleansupportsLineNumbers()
     Whether draw graphics supports displaying of line numbers.
public  booleantargetOffsetReached(int offset, char ch, int x, int charWidth, DrawContext ctx)
     This method is called to notify this draw graphics in response from targetPos parameter passed to draw().
Parameters:
  offset - position that was reached during the drawing.
Parameters:
  ch - character at offset
Parameters:
  charWidth - visual width of the character ch
Parameters:
  ctx - current draw context containing whether the drawing should continue or not.



Method Detail
drawChars
public void drawChars(int offset, int length, int width, Color strikeThroughColor, Color underlineColor)(Code)
Draw characters from the specified offset in the buffer
Parameters:
  offset - offset in the buffer for drawn text; if the text containstabs, then offset is set to -1 and length contains the countof the space characters that correspond to the expanded tabs
Parameters:
  length - length of the text being drawn
Parameters:
  width - width of the text being drawn in points. The currentx-coordinate must be increased by width automatically.
Parameters:
  strikeThroughColor - color to be used for strike-through or null if thestrike-through shouldn't be done.
Parameters:
  underlineColor - color to be used for underlining or null if the underliningshouldn't be done.



drawTabs
public void drawTabs(int offset, int length, int spaceCount, int width, Color strikeThroughColor, Color underlineColor)(Code)
Draw the expanded tab characters.
Parameters:
  offset - offset in the buffer where the tab characters start.
Parameters:
  length - number of the tab characters
Parameters:
  spaceCount - number of spaces that replace the tabs
Parameters:
  width - width of the spaces in points. The current x-coordinate mustbe increased by width automatically.
Parameters:
  strikeThroughColor - color to be used for strike-through or null if thestrike-through shouldn't be done.
Parameters:
  underlineColor - color to be used for underlining or null if the underliningshouldn't be done.



eol
public void eol()(Code)
EOL encountered and should be handled.



fillRect
public void fillRect(int width)(Code)
Fill rectangle at the current [x, y] with the current background color.
Parameters:
  width - width of the rectangle to fill in points. The currentx-coordinate must be increased by width automatically.



finish
public void finish()(Code)
Called when whole drawing ends. Can be used to deallocate some resources etc.



getGraphics
public Graphics getGraphics()(Code)
Get the AWT-graphics to determine whether this draws to a graphics. This is useful for fast line numbering and others.



init
public void init(DrawContext ctx)(Code)
Initialize this draw graphics before drawing



setBackColor
public void setBackColor(Color backColor)(Code)
Set background color



setBuffer
public void setBuffer(char[] buffer)(Code)
Set character buffer from which the characters are drawn.



setDefaultBackColor
public void setDefaultBackColor(Color defaultBackColor)(Code)
Inform the draw-graphics about the current background color of the component.



setFont
public void setFont(Font font)(Code)
Set current font



setForeColor
public void setForeColor(Color foreColor)(Code)
Set foreground color



setLineAscent
public void setLineAscent(int lineAscent)(Code)
Set the ascent of the line.



setLineHeight
public void setLineHeight(int lineHeight)(Code)
Set the height of the line.



setX
public void setX(int x)(Code)
Set the current x-coordinate



setY
public void setY(int y)(Code)
Set the current y-coordinate



supportsLineNumbers
public boolean supportsLineNumbers()(Code)
Whether draw graphics supports displaying of line numbers. If not line number displaying is not done.



targetOffsetReached
public boolean targetOffsetReached(int offset, char ch, int x, int charWidth, DrawContext ctx)(Code)
This method is called to notify this draw graphics in response from targetPos parameter passed to draw().
Parameters:
  offset - position that was reached during the drawing.
Parameters:
  ch - character at offset
Parameters:
  charWidth - visual width of the character ch
Parameters:
  ctx - current draw context containing whether the drawing should continue or not. If it returns falseit's guaranteed that this method will not be called again and thewhole draw() method will be stopped.
The only exception is when the -1 is used as the target offsetwhen draw() is called which means that every offset is apotential target offset and must be checked. In this case thebinary search is used when finding the target offset insidepainted fragment. That greatly improves performance for longfragments because the font metrics measurements are relativelyexpensive.



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