Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.RadioCheckField


        PdfFormField radiogroup = PdfFormField.createRadioButton(writer, true);
        radiogroup.setFieldName(UUID.randomUUID().toString());
        if(locked) {
            radiogroup.setFieldFlags(BaseField.READ_ONLY);
        }
        RadioCheckField radio;
        for (int i = 0; i < values.length; i++) {
            try {
                Rectangle rect = getBoxRectangle(rectangle, i);
                radio = new RadioCheckField(writer, rect, null, UUID.randomUUID().toString());
                radio.setBorderColor(GrayColor.GRAYBLACK);
                radio.setBackgroundColor(GrayColor.GRAYWHITE);
                radio.setCheckType(RadioCheckField.TYPE_CIRCLE);
                if(value != null && values[i].equals(value)) {
                    radio.setChecked(true);
                }
                PdfFormField field = radio.getRadioField();
                radiogroup.addKid(field);
                addBoxDescription(rectangle, i, values, canvases);
            } catch (IOException ex) {
                Logger.getLogger(ITextRadio.class.getName()).log(Level.SEVERE, null, ex);
            } catch (DocumentException ex) {
View Full Code Here


        onOff[1].moveTo(1, 1);
        onOff[1].lineTo(19, 19);
        onOff[1].moveTo(1, 19);
        onOff[1].lineTo(19, 1);
        onOff[1].stroke();
        RadioCheckField checkbox;
        Font f = new Font();
        f.setSize(ITextInputText.FONTSIZE);
        for (int i = 0; i < values.length; i++) {
            try {
                Rectangle rect = ITextRadio.getBoxRectangle(rectangle, i);
                checkbox = new RadioCheckField(writer, rect, UUID.randomUUID().toString(), "Yes");
                boolean checked = false;
                if (selectedValues != null) {
                    for (int i2 = 0; i2 < selectedValues.length; i2++) {
                        if (values[i].equals(selectedValues[i2])) {
                            checked = true;
                            break;
                        }
                    }
                }
                checkbox.setChecked(checked);
                PdfFormField field = checkbox.getCheckField();
                field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Off", onOff[0]);
                field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Yes", onOff[1]);
                if (locked) {
                    field.setFieldFlags(BaseField.READ_ONLY);
                }
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.RadioCheckField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.