📄 formelement.java
字号:
// $Id: FormElement.java,v 1.2 2003/10/06 12:40:06 mike Exp $package org.faceless.pdf;import java.util.*;import java.awt.Color;/** * The <code>FormElement</code> class is the baseclass for all * elements which may be added to a {@link Form}. * * @since 1.1.13 */public abstract class FormElement extends PeeredObject{ /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a check mark (a tick). This is * the default for {@link FormCheckbox} elements. * @since 1.1.23 */ public static final int STYLE_CHECK=0x2714; /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a filled circle. This is the * default for {@link FormRadioButton} elements. * @since 1.1.23 */ public static final int STYLE_CIRCLE=0x25CF; /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a cross or "X" * @since 1.1.23 */ public static final int STYLE_CROSS=0x2718; /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a filled square * @since 1.1.23 */ public static final int STYLE_SQUARE=0x25A0; /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a filled diamond * @since 1.1.23 */ public static final int STYLE_DIAMOND=0x25C6; /** * A style to use for <code>Checkbox</code> and <code>RadioButton</code> * elements which sets its appearance to a filled five-pointed star * @since 1.1.23 */ public static final int STYLE_STAR=0x2605; final org.faceless.pdf2.FormElement element; Object getPeer() { return element; } FormElement(org.faceless.pdf2.FormElement element) { this.element=element; } /** * Get the list of annotations (visible appearances) associated with this Form element. * Signatures may have no annotations at all, radio buttons usually have * several, and most other fields will usually (but not always) have a * single annotation. * @return the list of annotations associated with the form element * @since 1.1.23 */ public PDFAnnotation[] getAnnotations() { List l = element.getAnnotations(); PDFAnnotation[] z = new PDFAnnotation[l.size()]; for (int i=0;i<z.length;i++) { z[i]=(PDFAnnotation)PeeredObject.getPeer(l.get(i)); } return z; } /** * Set whether the field is read-only or not. * @param readonly whether the field is read-only or not * @since 1.1.23 */ public void setReadOnly(boolean readonly) { element.setReadOnly(readonly); } /** * Get whether the field is read-only or not. * @return true if the field is read-only * @since 1.1.23 */ public boolean isReadOnly() { return element.isReadOnly(); } /** * Set whether the field is required before the form is submitted. * For some fields like pushbuttons, this method has no effect. * @param required whether the field is a required field or not * @since 1.1.23 */ public void setRequired(boolean required) { element.setRequired(required); } /** * Get whether the field is required before the form is submitted. * For some fields like pushbuttons, this method always returns false. * @return true if the field is required on form submission * @since 1.1.23 */ public boolean isRequired() { return element.isRequired(); } /** * Set whether the field is submitted or not. The default for * every element in the form is true. * @param submit whether the element is submitted or not. * @since 1.1.23 */ public void setSubmitted(boolean submit) { element.setSubmitted(submit); } /** * Get whether the field is submitted or not. * @return true if the field is submitted, false otherwise * @since 1.1.23 */ public boolean isSubmitted() { return element.isSubmitted(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -