Java Doc for RadioCheckField.java in  » PDF » pdf-itext » com » lowagie » text » pdf » 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 » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lowagie.text.pdf.BaseField
      com.lowagie.text.pdf.RadioCheckField

RadioCheckField
public class RadioCheckField extends BaseField (Code)
Creates a radio or a check field.

Example usage:

 Document document = new Document(PageSize.A4, 50, 50, 50, 50);
 PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("output.pdf"));
 document.open();
 PdfContentByte cb = writer.getDirectContent();
 RadioCheckField bt = new RadioCheckField(writer, new Rectangle(100, 100, 200, 200), "radio", "v1");
 bt.setCheckType(RadioCheckField.TYPE_CIRCLE);
 bt.setBackgroundColor(Color.cyan);
 bt.setBorderStyle(PdfBorderDictionary.STYLE_SOLID);
 bt.setBorderColor(Color.red);
 bt.setTextColor(Color.yellow);
 bt.setBorderWidth(BaseField.BORDER_WIDTH_THICK);
 bt.setChecked(false);
 PdfFormField f1 = bt.getRadioField();
 bt.setOnValue("v2");
 bt.setChecked(true);
 bt.setBox(new Rectangle(100, 300, 200, 400));
 PdfFormField f2 = bt.getRadioField();
 bt.setChecked(false);
 PdfFormField top = bt.getRadioGroup(true, false);
 bt.setOnValue("v3");
 bt.setBox(new Rectangle(100, 500, 200, 600));
 PdfFormField f3 = bt.getRadioField();
 top.addKid(f1);
 top.addKid(f2);
 top.addKid(f3);
 writer.addAnnotation(top);
 bt = new RadioCheckField(writer, new Rectangle(300, 300, 400, 400), "check1", "Yes");
 bt.setCheckType(RadioCheckField.TYPE_CHECK);
 bt.setBorderWidth(BaseField.BORDER_WIDTH_THIN);
 bt.setBorderColor(Color.black);
 bt.setBackgroundColor(Color.white);
 PdfFormField ck = bt.getCheckField();
 writer.addAnnotation(ck);
 document.close();
 

author:
   Paulo Soares (psoares@consiste.pt)


Field Summary
final public static  intTYPE_CHECK
    
final public static  intTYPE_CIRCLE
    
final public static  intTYPE_CROSS
    
final public static  intTYPE_DIAMOND
    
final public static  intTYPE_SQUARE
    
final public static  intTYPE_STAR
    

Constructor Summary
public  RadioCheckField(PdfWriter writer, Rectangle box, String fieldName, String onValue)
     Creates a new instance of RadioCheckField
Parameters:
  writer - the document PdfWriter
Parameters:
  box - the field location and dimensions
Parameters:
  fieldName - the field name.

Method Summary
public  PdfAppearancegetAppearance(boolean isRadio, boolean on)
     Gets the field appearance.
public  PdfAppearancegetAppearanceRadioCircle(boolean on)
     Gets the special field appearance for the radio circle.
public  PdfFormFieldgetCheckField()
     Gets the check field.
public  intgetCheckType()
     Getter for property checkType.
protected  PdfFormFieldgetField(boolean isRadio)
     Gets a radio or check field.
public  StringgetOnValue()
     Getter for property onValue.
public  PdfFormFieldgetRadioField()
     Gets the radio field.
public  PdfFormFieldgetRadioGroup(boolean noToggleToOff, boolean radiosInUnison)
     Gets a radio group.
public  booleanisChecked()
     Getter for property checked.
public  voidsetCheckType(int checkType)
     Sets the checked symbol.
public  voidsetChecked(boolean checked)
     Sets the state of the field to checked or unchecked.
public  voidsetOnValue(String onValue)
     Sets the value when the field is checked.

Field Detail
TYPE_CHECK
final public static int TYPE_CHECK(Code)
A field with the symbol check



TYPE_CIRCLE
final public static int TYPE_CIRCLE(Code)
A field with the symbol circle



TYPE_CROSS
final public static int TYPE_CROSS(Code)
A field with the symbol cross



TYPE_DIAMOND
final public static int TYPE_DIAMOND(Code)
A field with the symbol diamond



TYPE_SQUARE
final public static int TYPE_SQUARE(Code)
A field with the symbol square



TYPE_STAR
final public static int TYPE_STAR(Code)
A field with the symbol star




Constructor Detail
RadioCheckField
public RadioCheckField(PdfWriter writer, Rectangle box, String fieldName, String onValue)(Code)
Creates a new instance of RadioCheckField
Parameters:
  writer - the document PdfWriter
Parameters:
  box - the field location and dimensions
Parameters:
  fieldName - the field name. It must not be null
Parameters:
  onValue - the value when the field is checked




Method Detail
getAppearance
public PdfAppearance getAppearance(boolean isRadio, boolean on) throws IOException, DocumentException(Code)
Gets the field appearance.
Parameters:
  isRadio - true for a radio field and falsefor a check field
Parameters:
  on - true for the checked state, falseotherwise
throws:
  IOException - on error
throws:
  DocumentException - on error the appearance



getAppearanceRadioCircle
public PdfAppearance getAppearanceRadioCircle(boolean on)(Code)
Gets the special field appearance for the radio circle.
Parameters:
  on - true for the checked state, falseotherwise the appearance



getCheckField
public PdfFormField getCheckField() throws IOException, DocumentException(Code)
Gets the check field. the check field
throws:
  IOException - on error
throws:
  DocumentException - on error



getCheckType
public int getCheckType()(Code)
Getter for property checkType. Value of property checkType.



getField
protected PdfFormField getField(boolean isRadio) throws IOException, DocumentException(Code)
Gets a radio or check field.
Parameters:
  isRadio - true to get a radio field, false to geta check field
throws:
  IOException - on error
throws:
  DocumentException - on error the field



getOnValue
public String getOnValue()(Code)
Getter for property onValue. Value of property onValue.



getRadioField
public PdfFormField getRadioField() throws IOException, DocumentException(Code)
Gets the radio field. It's only composed of the widget keys and must be used with RadioCheckField.getRadioGroup(boolean,boolean) . the radio field
throws:
  IOException - on error
throws:
  DocumentException - on error



getRadioGroup
public PdfFormField getRadioGroup(boolean noToggleToOff, boolean radiosInUnison)(Code)
Gets a radio group. It's composed of the field specific keys, without the widget ones. This field is to be used as a field aggregator with PdfFormField.addKid(PdfFormField) addKid() .
Parameters:
  noToggleToOff - if true, exactly one radio button must be selected at alltimes; clicking the currently selected button has no effect.If false, clickingthe selected button deselects it, leaving no button selected.
Parameters:
  radiosInUnison - if true, a group of radio buttons within a radio button field thatuse the same value for the on state will turn on and off in unison; that is ifone is checked, they are all checked. If false, the buttons are mutually exclusive(the same behavior as HTML radio buttons) the radio group



isChecked
public boolean isChecked()(Code)
Getter for property checked. Value of property checked.



setCheckType
public void setCheckType(int checkType)(Code)
Sets the checked symbol. It can be TYPE_CHECK, TYPE_CIRCLE, TYPE_CROSS, TYPE_DIAMOND, TYPE_SQUARE and TYPE_STAR.
Parameters:
  checkType - the checked symbol



setChecked
public void setChecked(boolean checked)(Code)
Sets the state of the field to checked or unchecked.
Parameters:
  checked - the state of the field, true for checkedand false for unchecked



setOnValue
public void setOnValue(String onValue)(Code)
Sets the value when the field is checked.
Parameters:
  onValue - the value when the field is checked



Fields inherited from com.lowagie.text.pdf.BaseField
final public static float BORDER_WIDTH_MEDIUM(Code)(Java Doc)
final public static float BORDER_WIDTH_THICK(Code)(Java Doc)
final public static float BORDER_WIDTH_THIN(Code)(Java Doc)
final public static int COMB(Code)(Java Doc)
final public static int DO_NOT_SCROLL(Code)(Java Doc)
final public static int DO_NOT_SPELL_CHECK(Code)(Java Doc)
final public static int EDIT(Code)(Java Doc)
final public static int FILE_SELECTION(Code)(Java Doc)
final public static int HIDDEN(Code)(Java Doc)
final public static int HIDDEN_BUT_PRINTABLE(Code)(Java Doc)
final public static int MULTILINE(Code)(Java Doc)
final public static int PASSWORD(Code)(Java Doc)
final public static int READ_ONLY(Code)(Java Doc)
final public static int REQUIRED(Code)(Java Doc)
final public static int VISIBLE(Code)(Java Doc)
final public static int VISIBLE_BUT_DOES_NOT_PRINT(Code)(Java Doc)
protected int alignment(Code)(Java Doc)
protected Color backgroundColor(Code)(Java Doc)
protected Color borderColor(Code)(Java Doc)
protected int borderStyle(Code)(Java Doc)
protected float borderWidth(Code)(Java Doc)
protected Rectangle box(Code)(Java Doc)
protected String fieldName(Code)(Java Doc)
protected BaseFont font(Code)(Java Doc)
protected float fontSize(Code)(Java Doc)
protected int maxCharacterLength(Code)(Java Doc)
protected int options(Code)(Java Doc)
protected int rotation(Code)(Java Doc)
protected String text(Code)(Java Doc)
protected Color textColor(Code)(Java Doc)
protected int visibility(Code)(Java Doc)
protected PdfWriter writer(Code)(Java Doc)

Methods inherited from com.lowagie.text.pdf.BaseField
protected static ArrayList breakLines(ArrayList breaks, BaseFont font, float fontSize, float width)(Code)(Java Doc)
public int getAlignment()(Code)(Java Doc)
public Color getBackgroundColor()(Code)(Java Doc)
protected PdfAppearance getBorderAppearance()(Code)(Java Doc)
public Color getBorderColor()(Code)(Java Doc)
public int getBorderStyle()(Code)(Java Doc)
public float getBorderWidth()(Code)(Java Doc)
public Rectangle getBox()(Code)(Java Doc)
public String getFieldName()(Code)(Java Doc)
public BaseFont getFont()(Code)(Java Doc)
public float getFontSize()(Code)(Java Doc)
protected static ArrayList getHardBreaks(String text)(Code)(Java Doc)
public int getMaxCharacterLength()(Code)(Java Doc)
public int getOptions()(Code)(Java Doc)
protected BaseFont getRealFont() throws IOException, DocumentException(Code)(Java Doc)
public int getRotation()(Code)(Java Doc)
public String getText()(Code)(Java Doc)
public Color getTextColor()(Code)(Java Doc)
public int getVisibility()(Code)(Java Doc)
public PdfWriter getWriter()(Code)(Java Doc)
public static void moveFields(PdfDictionary from, PdfDictionary to)(Code)(Java Doc)
public void setAlignment(int alignment)(Code)(Java Doc)
public void setBackgroundColor(Color backgroundColor)(Code)(Java Doc)
public void setBorderColor(Color borderColor)(Code)(Java Doc)
public void setBorderStyle(int borderStyle)(Code)(Java Doc)
public void setBorderWidth(float borderWidth)(Code)(Java Doc)
public void setBox(Rectangle box)(Code)(Java Doc)
public void setFieldName(String fieldName)(Code)(Java Doc)
public void setFont(BaseFont font)(Code)(Java Doc)
public void setFontSize(float fontSize)(Code)(Java Doc)
public void setMaxCharacterLength(int maxCharacterLength)(Code)(Java Doc)
public void setOptions(int options)(Code)(Java Doc)
public void setRotation(int rotation)(Code)(Java Doc)
public void setRotationFromPage(Rectangle page)(Code)(Java Doc)
public void setText(String text)(Code)(Java Doc)
public void setTextColor(Color textColor)(Code)(Java Doc)
public void setVisibility(int visibility)(Code)(Java Doc)
public void setWriter(PdfWriter writer)(Code)(Java Doc)
protected static void trimRight(StringBuffer buf)(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.