當前位置: 首頁>>代碼示例>>Java>>正文


Java MediaSizeName.B屬性代碼示例

本文整理匯總了Java中javax.print.attribute.standard.MediaSizeName.B屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaSizeName.B屬性的具體用法?Java MediaSizeName.B怎麽用?Java MediaSizeName.B使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.print.attribute.standard.MediaSizeName的用法示例。


在下文中一共展示了MediaSizeName.B屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

public static void main(String args[]) {
    MediaSize sizeA = MediaSize.getMediaSizeForName(MediaSizeName.A);
    new MediaSize(1.0f, 2.0f, MediaSize.MM, MediaSizeName.A);
    if (!sizeA.equals(MediaSize.getMediaSizeForName(MediaSizeName.A))) {
         throw new RuntimeException("mapping changed");
    }
    MediaSize sizeB = MediaSize.getMediaSizeForName(MediaSizeName.B);
    new MediaSize(1, 2, MediaSize.MM, MediaSizeName.B);
    if (!sizeB.equals(MediaSize.getMediaSizeForName(MediaSizeName.B))) {
         throw new RuntimeException("mapping changed");
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:MediaMappingsTest.java

示例2: selectMediaSizeNameOther

public MediaSizeName selectMediaSizeNameOther(String size) {
    if (size.equalsIgnoreCase("executive")) {
        mediaSizeName = MediaSizeName.EXECUTIVE;
    } else if (size.equalsIgnoreCase("ledger")) {
        mediaSizeName = MediaSizeName.LEDGER;
    } else if (size.equalsIgnoreCase("tabloid")) {
        mediaSizeName = MediaSizeName.TABLOID;
    } else if (size.equalsIgnoreCase("invoice")) {
        mediaSizeName = MediaSizeName.INVOICE;
    } else if (size.equalsIgnoreCase("folio")) {
        mediaSizeName = MediaSizeName.FOLIO;
    } else if (size.equalsIgnoreCase("quarto")) {
        mediaSizeName = MediaSizeName.QUARTO;
    } else if (size.equalsIgnoreCase("japanese_postcard")) {
        mediaSizeName = MediaSizeName.JAPANESE_POSTCARD;
    } else if (size.equalsIgnoreCase("oufuko_postcard")) {
        mediaSizeName = MediaSizeName.JAPANESE_DOUBLE_POSTCARD;
    } else if (size.equalsIgnoreCase("a")) {
        mediaSizeName = MediaSizeName.A;
    } else if (size.equalsIgnoreCase("b")) {
        mediaSizeName = MediaSizeName.B;
    } else if (size.equalsIgnoreCase("c")) {
        mediaSizeName = MediaSizeName.C;
    } else if (size.equalsIgnoreCase("d")) {
        mediaSizeName = MediaSizeName.D;
    } else if (size.equalsIgnoreCase("e")) {
        mediaSizeName = MediaSizeName.E;
    } else if (size.equalsIgnoreCase("iso_designated_long")) {
        mediaSizeName = MediaSizeName.ISO_DESIGNATED_LONG;
    } else if (size.equalsIgnoreCase("italian_envelope")) {
        mediaSizeName = MediaSizeName.ITALY_ENVELOPE;
    } else if (size.equalsIgnoreCase("monarch_envelope")) {
        mediaSizeName = MediaSizeName.MONARCH_ENVELOPE;
    } else if (size.equalsIgnoreCase("personal_envelope")) {
        mediaSizeName = MediaSizeName.PERSONAL_ENVELOPE;
    }
    
    return mediaSizeName;

}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:40,代碼來源:MediaSizeAssigner.java

示例3: selectMediaSizeNameNA

public MediaSizeName selectMediaSizeNameNA(String size) {
    if (size.equalsIgnoreCase("na_letter")) {
        mediaSizeName = MediaSizeName.NA_LETTER;
    } else if (size.equalsIgnoreCase("na_legal")) {
        mediaSizeName = MediaSizeName.NA_LEGAL;
    } else if (size.equalsIgnoreCase("executive")) {
        mediaSizeName = MediaSizeName.EXECUTIVE;
    } else if (size.equalsIgnoreCase("ledger")) {
        mediaSizeName = MediaSizeName.LEDGER;
    } else if (size.equalsIgnoreCase("tabloid")) {
        mediaSizeName = MediaSizeName.TABLOID;
    } else if (size.equalsIgnoreCase("invoice")) {
        mediaSizeName = MediaSizeName.INVOICE;
    } else if (size.equalsIgnoreCase("folio")) {
        mediaSizeName = MediaSizeName.FOLIO;
    } else if (size.equalsIgnoreCase("quarto")) {
        mediaSizeName = MediaSizeName.QUARTO;
    } else if (size.equalsIgnoreCase("japanese_postcard")) {
        mediaSizeName = MediaSizeName.JAPANESE_POSTCARD;
    } else if (size.equalsIgnoreCase("oufuko_postcard")) {
        mediaSizeName = MediaSizeName.JAPANESE_DOUBLE_POSTCARD;
    } else if (size.equalsIgnoreCase("a")) {
        mediaSizeName = MediaSizeName.A;
    } else if (size.equalsIgnoreCase("b")) {
        mediaSizeName = MediaSizeName.B;
    } else if (size.equalsIgnoreCase("c")) {
        mediaSizeName = MediaSizeName.C;
    } else if (size.equalsIgnoreCase("d")) {
        mediaSizeName = MediaSizeName.D;
    } else if (size.equalsIgnoreCase("e")) {
        mediaSizeName = MediaSizeName.E;
    } else if (size.equalsIgnoreCase("iso_designated_long")) {
        mediaSizeName = MediaSizeName.ISO_DESIGNATED_LONG;
    } else if (size.equalsIgnoreCase("italian_envelope")) {
        mediaSizeName = MediaSizeName.ITALY_ENVELOPE;
    } else if (size.equalsIgnoreCase("monarch_envelope")) {
        mediaSizeName = MediaSizeName.MONARCH_ENVELOPE;
    } else if (size.equalsIgnoreCase("personal_envelope")) {
        mediaSizeName = MediaSizeName.PERSONAL_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_number_9_envelope")) {
        mediaSizeName = MediaSizeName.NA_NUMBER_9_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_number_10_envelope")) {
        mediaSizeName = MediaSizeName.NA_NUMBER_10_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_number_11_envelope")) {
        mediaSizeName = MediaSizeName.NA_NUMBER_11_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_number_12_envelope")) {
        mediaSizeName = MediaSizeName.NA_NUMBER_12_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_number_14_envelope")) {
        mediaSizeName = MediaSizeName.NA_NUMBER_14_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_6x9_envelope")) {
        mediaSizeName = MediaSizeName.NA_6X9_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_7x9_envelope")) {
        mediaSizeName = MediaSizeName.NA_7X9_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_9x11_envelope")) {
        mediaSizeName = MediaSizeName.NA_9X11_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_9x12_envelope")) {
        mediaSizeName = MediaSizeName.NA_9X12_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_10x13_envelope")) {
        mediaSizeName = MediaSizeName.NA_10X13_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_10x14_envelope")) {
        mediaSizeName = MediaSizeName.NA_10X14_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_10x15_envelope")) {
        mediaSizeName = MediaSizeName.NA_10X15_ENVELOPE;
    } else if (size.equalsIgnoreCase("na_5x7")) {
        mediaSizeName = MediaSizeName.NA_5X7;
    } else if (size.equalsIgnoreCase("na_8x10")) {
        mediaSizeName = MediaSizeName.NA_8X10;
    } else {
        mediaSizeName = MediaSizeName.NA_LETTER;
    }
    
    return mediaSizeName;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:73,代碼來源:MediaSizeAssigner.java


注:本文中的javax.print.attribute.standard.MediaSizeName.B屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。