Package ugh.dl

Examples of ugh.dl.RomanNumeral


    generateElements(start, end, increment);

  }

  private void generateElements(int start, int end, int increment) {
    RomanNumeral r = new RomanNumeral();
    for (int i = start; i <= end; i = (i + increment)) {
      r.setValue(i);
      this.add(r.toString());
    }
  }
View Full Code Here


                    mdTemp = new Metadata(mdt);

                    if (defaultPagination.equalsIgnoreCase("arabic")) {
                        mdTemp.setValue(String.valueOf(currentPhysicalOrder));
                    } else if (defaultPagination.equalsIgnoreCase("roman")) {
                        RomanNumeral roman = new RomanNumeral();
                        roman.setValue(currentPhysicalOrder);
                        mdTemp.setValue(roman.getNumber());
                    } else {
                        mdTemp.setValue("uncounted");
                    }

                    dsPage.addMetadata(mdTemp);
                    log.addReferenceTo(dsPage, "logical_physical");

                    // image name
                    ContentFile cf = new ContentFile();
                    if (SystemUtils.IS_OS_WINDOWS) {
                        cf.setLocation("file:/" + inProzess.getImagesTifDirectory(false) + newImage);
                    } else {
                        cf.setLocation("file://" + inProzess.getImagesTifDirectory(false) + newImage);
                    }
                    dsPage.addContentFile(cf);

                } catch (TypeNotAllowedAsChildException e) {
                    logger.error(e);
                } catch (MetadataTypeNotAllowedException e) {
                    logger.error(e);
                }
            }
        }

        // case 3: empty page docs and unassinged images
        else {
            for (DocStruct page : pageElementsWithoutImages) {
                if (!imagesWithoutPageElements.isEmpty()) {
                    // assign new image name to page
                    String newImageName = imagesWithoutPageElements.get(0);
                    imagesWithoutPageElements.remove(0);
                    ContentFile cf = new ContentFile();
                    if (SystemUtils.IS_OS_WINDOWS) {
                        cf.setLocation("file:/" + inProzess.getImagesTifDirectory(false) + newImageName);
                    } else {
                        cf.setLocation("file://" + inProzess.getImagesTifDirectory(false) + newImageName);
                    }
                    page.addContentFile(cf);
                } else {
                    // remove page
                    physicaldocstruct.removeChild(page);
                    List<Reference> refs = new ArrayList<Reference>(page.getAllFromReferences());
                    for (ugh.dl.Reference ref : refs) {
                        ref.getSource().removeReferenceTo(page);
                    }
                }
            }
            if (!imagesWithoutPageElements.isEmpty()) {
                // create new page elements

                int currentPhysicalOrder = physicaldocstruct.getAllChildren().size();
                for (String newImage : imagesWithoutPageElements) {
                    DocStruct dsPage = this.mydocument.createDocStruct(newPage);
                    try {
                        // physical page no
                        physicaldocstruct.addChild(dsPage);
                        MetadataType mdt = this.myPrefs.getMetadataTypeByName("physPageNumber");
                        Metadata mdTemp = new Metadata(mdt);
                        mdTemp.setValue(String.valueOf(++currentPhysicalOrder));
                        dsPage.addMetadata(mdTemp);

                        // logical page no
                        mdt = this.myPrefs.getMetadataTypeByName("logicalPageNumber");
                        mdTemp = new Metadata(mdt);

                        if (defaultPagination.equalsIgnoreCase("arabic")) {
                            mdTemp.setValue(String.valueOf(currentPhysicalOrder));
                        } else if (defaultPagination.equalsIgnoreCase("roman")) {
                            RomanNumeral roman = new RomanNumeral();
                            roman.setValue(currentPhysicalOrder);
                            mdTemp.setValue(roman.getNumber());
                        } else {
                            mdTemp.setValue("uncounted");
                        }

                        dsPage.addMetadata(mdTemp);
View Full Code Here

  private String getNextPaginationLabel(int firstPageNumber, int paginationBaseValue, double currentPageNumber) {
    String actualPaginationLabel;
    if (this.paginationType.equals(PAGINATION_ARABIC)) {
      actualPaginationLabel = String.valueOf(paginationBaseValue + (int) currentPageNumber - firstPageNumber);
    } else if (this.paginationType.equals(PAGINATION_ROMAN)) {
      RomanNumeral r = new RomanNumeral();
      r.setValue(paginationBaseValue + (int) currentPageNumber - firstPageNumber);
      actualPaginationLabel = r.toString();
    } else if (this.paginationType.equals(PAGINATION_ARABIC_BRACKET)) {
      actualPaginationLabel = String.valueOf(paginationBaseValue + (int) currentPageNumber - firstPageNumber);
      actualPaginationLabel = "[" + actualPaginationLabel + "]";
    } else if (this.paginationType.equals(PAGINATION_ROMAN_BRACKET)) {
      RomanNumeral r = new RomanNumeral();
      r.setValue(paginationBaseValue + (int) currentPageNumber - firstPageNumber);
      actualPaginationLabel = "[" + r.toString() + "]";

    } else {
      // free text
      actualPaginationLabel = this.paginationStartValue;
    }
View Full Code Here

    int paginationBaseValue = 1;

    if (this.paginationType.equals(PAGINATION_ARABIC) || this.paginationType.equals(PAGINATION_ARABIC_BRACKET)) {
      paginationBaseValue = Integer.parseInt(this.paginationStartValue);
    } else if (this.paginationType.equals(PAGINATION_ROMAN) || this.paginationType.equals(PAGINATION_ROMAN_BRACKET)) {
      RomanNumeral r = new RomanNumeral();
      r.setValue(this.paginationStartValue);
      paginationBaseValue = r.intValue();
    }

    return paginationBaseValue;

  }
View Full Code Here

    return true;
  }

  private boolean isValidRomanNumber() {
    try {
      RomanNumeral roman = new RomanNumeral();
      this.paginationStartValue = this.paginationStartValue.toUpperCase();
      roman.setValue(this.paginationStartValue);
      return true;
    } catch (NumberFormatException nfe) {
      Helper.setFehlerMeldung("fehlerBeimEinlesen", nfe.getMessage());
      return false;
    }
View Full Code Here

    if (paginationType == Paginator.Type.ARABIC) {
      Integer.parseInt(paginationStartValue);
    }
    // roman numbers
    if (paginationType == Paginator.Type.ROMAN) {
      RomanNumeral roman = new RomanNumeral();
      roman.setValue(paginationStartValue);
    }
  }
View Full Code Here

    int paginationBaseValue = 1;

    if (paginationType == Paginator.Type.ARABIC) {
      paginationBaseValue = Integer.parseInt(paginationStartValue);
    } else if (paginationType == Paginator.Type.ROMAN) {
      RomanNumeral r = new RomanNumeral();
      r.setValue(paginationStartValue);
      paginationBaseValue = r.intValue();
    }

    return paginationBaseValue;

  }
View Full Code Here

TOP

Related Classes of ugh.dl.RomanNumeral

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.