Examples of FormObject


Examples of models.FormObject

                        getServerAddress() + "/form",
                        headers,
                        formParameters);
       
        ObjectMapper objectMapper = new ObjectMapper();
        FormObject returnedObject = objectMapper.readValue(response, FormObject.class);

        // And assert that returned object has same values
        assertEquals("tester", returnedObject.name);
        assertEquals("test@email.com", returnedObject.getEmail());
       
        assertEquals(593765, returnedObject.primInt);
        assertEquals(593766, returnedObject.objInt.intValue());
       
        assertEquals(-3957393, returnedObject.primLong);
        assertEquals(-3957394, returnedObject.objLong.longValue());
       
        assertEquals(78.12, returnedObject.primFloat, 0.001);
        assertEquals(79.22, returnedObject.objFloat.floatValue(), 0.001);
       
        assertEquals(694.56, returnedObject.primDouble, 0.001);
        assertEquals(696.76, returnedObject.objDouble.doubleValue(), 0.001);
       
        assertEquals(false, returnedObject.isPrimBoolean());
        assertEquals(true, returnedObject.getObjBoolean().booleanValue());
       
        assertEquals(111, returnedObject.getPrimByte());
        assertEquals(112, returnedObject.getObjByte().byteValue());
       
        assertEquals(32456, returnedObject.getPrimShort());
        assertEquals(32455, returnedObject.getObjShort().shortValue());
       
        assertEquals('Z', returnedObject.getPrimChar());
        assertEquals('X', returnedObject.getObjChar().charValue());
    }
View Full Code Here

Examples of models.FormObject

    @Timed
    public Result directObjectTemplateRendering() {
        // Uses Results.html().render(Object) to directly
        // render an object with a Freemarker template
        FormObject testObject = new FormObject();
        testObject.name = "test_name";
        testObject.primInt = 13579;
        testObject.setObjShort((short)-2954);
       
        return Results.html().render(testObject);
    }
View Full Code Here

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

Examples of org.jpedal.objects.raw.FormObject

    }
   
    //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

Examples of org.jpedal.objects.raw.FormObject

    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

Examples of org.jpedal.objects.raw.FormObject

      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

Examples of org.jpedal.objects.raw.FormObject

                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

Examples of org.jpedal.objects.raw.FormObject

    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

Examples of org.jpedal.objects.raw.FormObject

   
    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

Examples of org.jpedal.objects.raw.FormObject

          }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
TOP
Copyright © 2018 www.massapi.com. 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.