Package org.jpedal.objects.raw

Examples of org.jpedal.objects.raw.FormObject


                            //System.out.println(currentComp+" "+comp.getLocation()+" "+comp);
                            Object[] rawForm = this.getRawForm(ref);
                            for (Object aRawForm : rawForm) {
                                if (aRawForm != null) {
                                    FormObject form = (FormObject) aRawForm;
                                    System.out.println(ref + ' ' + form.getTextFont() + ' ' + form.getTextString());
                                }
                            }
                        } else if (isFormNotPrinted(currentComp)) {
                        } else if (comp instanceof JList && ((JList) comp).getSelectedIndex() != -1 && boundHeight < swingHeight) {
View Full Code Here


    }
   
    //scale border if needed
    if(!popups && curComp instanceof JComponent && ((JComponent)curComp).getBorder()!=null){
     
      FormObject form = (FormObject)rawFormData.get(convertIDtoRef(id));
      if(form!=null)
        ((JComponent)curComp).setBorder((Border)generateBorderfromForm(form,scale));
    }
   
    // factor in offset if multiple pages displayed
View Full Code Here

    for (int currentComp = getStartComponentCountForPage(page);
        currentComp<pageMap.length && pageMap[currentComp] == page; currentComp++) {
     
      int type=getFieldType(allFields[currentComp]);
     
      FormObject curForm = (FormObject)rawFormData.get(convertIDtoRef(currentComp));
      ActionHandler curHandler = acroRend.getActionHandler();
     
      //get the page object
      String pageRef = pdfDecoder.getReferenceforPage(currentPage);
      PageObject pdfObject=new PageObject(pageRef);
View Full Code Here

      String ref = this.convertIDtoRef(currentComp);
      Object[] rawForm = this.getRawForm(ref);

            for (Object aRawForm : rawForm) {
                if (aRawForm != null) {
                    FormObject formObject = (FormObject) aRawForm;
                    String parent = formObject.getStringKey(PdfDictionary.Parent);

                    //if it has a parent, store last value in parent so others can sync to it
                    if (parent != null) {
                        Object lastMapValue = LastValueByName.get(formObject.getTextStreamValue(PdfDictionary.T));

                        Component comp = allFields[currentComp];

                        if (allFieldsType[currentComp] == FormFactory.radiobutton || allFieldsType[currentComp] == FormFactory.checkboxbutton) { //NOTE Stores ref and not value

                            JToggleButton checkComp = ((JToggleButton) comp);
                            String currOnState = formObject.getNormalOnState();
                            //we know parents are the same
                            if ((currOnState == null && lastMapValue == null) ||
                                    (currOnState != null && currOnState.equals(lastMapValue))) {
                                //onstates and parents are the same this is treated as the same
                                //we need to make sure we are selected.
View Full Code Here

                int currentComp = -1;
                String ref;

                if (rawForm instanceof FormObject) {

                    FormObject formObject = (FormObject) rawForm;

                    String parent = formObject.getStringKey(PdfDictionary.Parent);


                    //if it has a parent, store last value in parent so others can sync to it
                    if (parent != null) {// && formObject.isKid()){
                        Object lastMapValue = LastValueByName.get(formObject.getTextStreamValue(PdfDictionary.T));

                        ref = formObject.getObjectRefAsString();

                        Object index = refToCompIndex.get(ref);
                        if (index == null)
                            continue;

                        currentComp = (Integer) index;

                        Component comp = allFields[currentComp];

                        if (allFieldsType[currentComp] == FormFactory.radiobutton || allFieldsType[currentComp] == FormFactory.checkboxbutton) { //NOTE Stores ref and not value

                            JToggleButton checkComp = ((JToggleButton) comp);
                            String currOnState = formObject.getNormalOnState();
                            //we know parents are the same
                            if ((currOnState == null && lastMapValue == null) ||
                                    (currOnState != null && currOnState.equals(lastMapValue))) {
                                //onstates and parents are the same this is treated as the same
                                //we need to make sure we are selected.
View Full Code Here

    Object[] forms = getRawForm(name);
        for (Object form1 : forms) {
            if (form1 == null)
                continue;

            FormObject form = (FormObject) form1;
            Object index = refToCompIndex.get(form.getObjectRefAsString());
            if (index == null)
                continue;

            int currentComp = (Integer) index;
            if (allFieldsType[currentComp] == FormFactory.radiobutton || allFieldsType[currentComp] == FormFactory.checkboxbutton) { //NOTE Stores ref and not value

                JToggleButton checkComp = ((JToggleButton) allFields[currentComp]);
                String currOnState = form.getNormalOnState();
                //we know parents are the same
                if ((currOnState == null && lastMapValue == null) ||
                        (currOnState != null && currOnState.equals(lastMapValue))) {
                    //onstates and parents are the same this is treated as the same
                    //we need to make sure we are selected.
View Full Code Here

   
    int index = (Integer) compIndex;
   
    if(allFieldsType[index]==FormFactory.combobox){
     
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      Object value = ((JComboBox) allFields[index]).getSelectedItem();
      form.setSelectedItem((String)value);
     
    }else if(allFieldsType[index]==FormFactory.list){
     
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      int[] values = ((JList) allFields[index]).getSelectedIndices();
      form.setTopIndex(values);
     
    }else if(allFieldsType[index]==FormFactory.radiobutton){
     
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      JRadioButton but = ((JRadioButton) allFields[index]);
      if(but.isSelected()){
        form.setChildOnState(FormUtils.removeStateToCheck(but.getName(), true));
      }
     
    }else if(allFieldsType[index]==FormFactory.checkboxbutton){
     
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      JCheckBox but = ((JCheckBox) allFields[index]);
      if(but.isSelected()){
        form.setCurrentState(FormUtils.removeStateToCheck(but.getName(), true));
      }
     
    }else if(allFieldsType[index]==FormFactory.singlelinepassword || allFieldsType[index]==FormFactory.multilinepassword){
     
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      String value = ((JTextComponent) allFields[index]).getText();
      form.setTextValue(value);
     
    }else if(allFieldsType[index]==FormFactory.singlelinetext || allFieldsType[index]==FormFactory.multilinetext){
      //these fields have readonlytexticons(JButtons) associated sometimes so allow for.
      FormObject form = (FormObject) rawFormData.get(fieldRef);
      if(allFields[index] instanceof JTextComponent){
        String value = ((JTextComponent) allFields[index]).getText();
        form.setTextValue(value);
      }else {
        //JButton read only ignore
      }
    }else if(allFieldsType[index]==FormFactory.pushbutton || allFieldsType[index]==FormFactory.annotation
        || allFieldsType[index]==FormFactory.signature){
View Full Code Here

          }else {
              PdfObject popupObj=formObj.getDictionary(PdfDictionary.Popup);
              currentPdfFile.checkResolved(popupObj);
             
              if(popupObj==null){
                popupObj = new FormObject();
                ((FormObject)popupObj).copyInheritedValuesFromParent(formObj);
                ((FormObject)popupObj).setParent(formObj.getObjectRefAsString());
                //dont set the parent object as this is a copy of the same object
              }
             
View Full Code Here

            preName = formObject.substring(formObject.indexOf('.') + 1,
                formObject.indexOf(".x") + 1);
          }
          if (formObject.contains(" R")) {

                       FormObject formObj=new FormObject(formObject);
                       currentPdfFile.readObject(formObj);


                        tok=formObj.getTextStreamValue(PdfDictionary.T);
                           if (preName != null) {
              names.append(preName);
            }
            names.append(tok);
            names.append(',');
View Full Code Here

     * @return page number or -1 if no page found
     */
    public int getPageForFormObject(String formName) {

        //Object checkObj;
        FormObject formObj=null;

    if (formName.contains("R")) {
    //  checkObj = refToCompIndex.get(formName);
            formObj = ((FormObject)rawFormData.get(formName));

    }else {
    //  checkObj = nameToCompIndex.get(formName);
            String ref= (String) nameToRef.get(formName);
            if(ref!=null)
            formObj = ((FormObject)rawFormData.get(ref));

    }

        if(formObj == null)
      return -1;
        else
            return formObj.getPageNumber();

  }
View Full Code Here

TOP

Related Classes of org.jpedal.objects.raw.FormObject

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.