• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SunPageSelection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.print.SunPageSelection的典型用法代码示例。如果您正苦于以下问题:Java SunPageSelection类的具体用法?Java SunPageSelection怎么用?Java SunPageSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SunPageSelection类属于sun.print包,在下文中一共展示了SunPageSelection类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import sun.print.SunPageSelection; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();
    SunPageSelection select = SunPageSelection.ALL;

    setupRangeWidgets();

    if (source == rbAll) {
        asCurrent.add(prAll);
    } else if (source == rbSelect) {
        select = SunPageSelection.SELECTION;
    } else if (source == rbPages ||
               source == tfRangeFrom ||
               source == tfRangeTo) {
        updateRangeAttribute();
        select = SunPageSelection.RANGE;
    }

    if (isAWT) {
        asCurrent.add(select);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ServiceDialog.java


示例2: getSelectAttrib

import sun.print.SunPageSelection; //导入依赖的package包/类
protected final int getSelectAttrib() {
    if (attributes != null) {
        SunPageSelection pages =
            (SunPageSelection)attributes.get(SunPageSelection.class);
        if (pages == SunPageSelection.RANGE) {
            return PD_PAGENUMS;
        } else if (pages == SunPageSelection.SELECTION) {
            return PD_SELECTION;
        } else if (pages ==  SunPageSelection.ALL) {
            return PD_ALLPAGES;
        }
    }
    return PD_NOSELECTION;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:RasterPrinterJob.java


示例3: setValues

import sun.print.SunPageSelection; //导入依赖的package包/类
final public void setValues() {

		this.bolGprintRangeSupported = this.objGprintJDialog.getPrintService().isAttributeCategorySupported(PageRanges.class);

		SunPageSelection objLsunPageSelection = SunPageSelection.ALL;
		int intLmin = 1;
		int intLmax = 1;

		final PageRanges objLpageRanges = (PageRanges) this.objGprintJDialog.getAttributes().get(PageRanges.class);
		if (objLpageRanges != null) {
			if (!objLpageRanges.equals(this.objGallPageRanges)) {
				objLsunPageSelection = SunPageSelection.RANGE;

				final int[][] intLmemberAA = objLpageRanges.getMembers();
				if (intLmemberAA.length > 0 && intLmemberAA[0].length > 1) {
					intLmin = intLmemberAA[0][0];
					intLmax = intLmemberAA[0][1];
				}
			}
		}

		if (objLsunPageSelection == SunPageSelection.ALL) {
			this.objGallJRadioButton.setSelected(true);
		} else if (objLsunPageSelection == SunPageSelection.SELECTION) {
			// Comment this for now - objGselectJRadioButton is not initialized
			// because Selection button is not added.
			// See PrintRangeSubJPanel above.

			// objGselectJRadioButton.setSelected(true);
		} else { // RANGE
			this.objGpagesJRadioButton.setSelected(true);
		}
		this.objGrangeFromJFormattedTextField.setValue(new Integer(intLmin));
		this.objGrangeToJFormattedTextField.setValue(new Integer(intLmax));
		this.objGallJRadioButton.setEnabled(this.bolGprintRangeSupported);
		this.objGpagesJRadioButton.setEnabled(this.bolGprintRangeSupported);
		this.setupRangeWidgets();
	}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:39,代码来源:PrintRangeSubJPanel.java


示例4: initPrintDialog

import sun.print.SunPageSelection; //导入依赖的package包/类
/**
 * Initialize print dialog.
 */
void initPrintDialog(int x, int y,
                     PrintService[] services,
                     int defaultServiceIndex,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.services = services;
    this.defaultServiceIndex = defaultServiceIndex;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);
    this.psCurrent = services[defaultServiceIndex];
    this.docFlavor = flavor;
    SunPageSelection pages =
        (SunPageSelection)attributes.get(SunPageSelection.class);
    if (pages != null) {
        isAWT = true;
    }

    if (attributes.get(DialogOnTop.class) != null) {
        setAlwaysOnTop(true);
    }
    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    tpTabs = new JTabbedPane();
    tpTabs.setBorder(new EmptyBorder(5, 5, 5, 5));

    String gkey = getMsg("tab.general");
    int gmnemonic = getVKMnemonic("tab.general");
    pnlGeneral = new GeneralPanel();
    tpTabs.add(gkey, pnlGeneral);
    tpTabs.setMnemonicAt(0, gmnemonic);

    String pkey = getMsg("tab.pagesetup");
    int pmnemonic = getVKMnemonic("tab.pagesetup");
    pnlPageSetup = new PageSetupPanel();
    tpTabs.add(pkey, pnlPageSetup);
    tpTabs.setMnemonicAt(1, pmnemonic);

    String akey = getMsg("tab.appearance");
    int amnemonic = getVKMnemonic("tab.appearance");
    pnlAppearance = new AppearancePanel();
    tpTabs.add(akey, pnlAppearance);
    tpTabs.setMnemonicAt(2, amnemonic);

    c.add(tpTabs, BorderLayout.CENTER);

    updatePanels();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.print", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.printtitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:73,代码来源:ServiceDialog.java


示例5: getSelectAttrib

import sun.print.SunPageSelection; //导入依赖的package包/类
private final int getSelectAttrib() {
    if (attributes != null) {
        SunPageSelection pages =
            (SunPageSelection)attributes.get(SunPageSelection.class);
        if (pages == SunPageSelection.RANGE) {
            return PD_PAGENUMS;
        } else if (pages == SunPageSelection.SELECTION) {
            return PD_SELECTION;
        } else if (pages ==  SunPageSelection.ALL) {
            return PD_ALLPAGES;
        }
    }
    return PD_NOSELECTION;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:15,代码来源:WPrinterJob.java


示例6: initPrintDialog

import sun.print.SunPageSelection; //导入依赖的package包/类
/**
 * Initialize print dialog.
 */
void initPrintDialog(int x, int y,
                     PrintService[] services,
                     int defaultServiceIndex,
                     DocFlavor flavor,
                     PrintRequestAttributeSet attributes)
{
    this.services = services;
    this.defaultServiceIndex = defaultServiceIndex;
    this.asOriginal = attributes;
    this.asCurrent = new HashPrintRequestAttributeSet(attributes);
    this.psCurrent = services[defaultServiceIndex];
    this.docFlavor = flavor;
    SunPageSelection pages =
        (SunPageSelection)attributes.get(SunPageSelection.class);
    if (pages != null) {
        isAWT = true;
    }

    Container c = getContentPane();
    c.setLayout(new BorderLayout());

    tpTabs = new JTabbedPane();
    tpTabs.setBorder(new EmptyBorder(5, 5, 5, 5));

    String gkey = getMsg("tab.general");
    int gmnemonic = getVKMnemonic("tab.general");
    pnlGeneral = new GeneralPanel();
    tpTabs.add(gkey, pnlGeneral);
    tpTabs.setMnemonicAt(0, gmnemonic);

    String pkey = getMsg("tab.pagesetup");
    int pmnemonic = getVKMnemonic("tab.pagesetup");
    pnlPageSetup = new PageSetupPanel();
    tpTabs.add(pkey, pnlPageSetup);
    tpTabs.setMnemonicAt(1, pmnemonic);

    String akey = getMsg("tab.appearance");
    int amnemonic = getVKMnemonic("tab.appearance");
    pnlAppearance = new AppearancePanel();
    tpTabs.add(akey, pnlAppearance);
    tpTabs.setMnemonicAt(2, amnemonic);

    c.add(tpTabs, BorderLayout.CENTER);

    updatePanels();

    JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    btnApprove = createExitButton("button.print", this);
    pnlSouth.add(btnApprove);
    getRootPane().setDefaultButton(btnApprove);
    btnCancel = createExitButton("button.cancel", this);
    handleEscKey(btnCancel);
    pnlSouth.add(btnCancel);
    c.add(pnlSouth, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            dispose(CANCEL);
        }
    });

    getAccessibleContext().setAccessibleDescription(getMsg("dialog.printtitle"));
    setResizable(false);
    setLocation(x, y);
    pack();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:70,代码来源:ServiceDialog.java


示例7: setNativeAttributes

import sun.print.SunPageSelection; //导入依赖的package包/类
private final void setNativeAttributes(int flags, int fields, int values) {
    if (attributes == null) {
        return;
    }
    if ((flags & PD_PRINTTOFILE) != 0) {
        Destination destPrn = (Destination)attributes.get(
                                             Destination.class);
        if (destPrn == null) {
            try {
                attributes.add(new Destination(
                                           new File("./out.prn").toURI()));
            } catch (SecurityException se) {
                try {
                    attributes.add(new Destination(
                                            new URI("file:out.prn")));
                } catch (URISyntaxException e) {
                }
            }
        }
    } else {
        attributes.remove(Destination.class);
    }

    if ((flags & PD_COLLATE) != 0) {
        setCollateAttrib(SheetCollate.COLLATED, attributes);
    } else {
        setCollateAttrib(SheetCollate.UNCOLLATED, attributes);
    }

    if ((flags & PD_PAGENUMS) != 0) {
        attributes.add(SunPageSelection.RANGE);
    } else if ((flags & PD_SELECTION) != 0) {
        attributes.add(SunPageSelection.SELECTION);
    } else {
        attributes.add(SunPageSelection.ALL);
    }

    if ((fields & DM_ORIENTATION) != 0) {
        if ((values & SET_ORIENTATION) != 0) {
            setOrientAttrib(OrientationRequested.LANDSCAPE, attributes);
        } else {
            setOrientAttrib(OrientationRequested.PORTRAIT, attributes);
        }
    }

    if ((fields & DM_COLOR) != 0) {
        if ((values & SET_COLOR) != 0) {
            setColorAttrib(Chromaticity.COLOR, attributes);
        } else {
            setColorAttrib(Chromaticity.MONOCHROME, attributes);
        }
    }

    if ((fields & DM_PRINTQUALITY) != 0) {
        PrintQuality quality;
        if ((values & SET_RES_LOW) != 0) {
            quality = PrintQuality.DRAFT;
        } else if ((fields & SET_RES_HIGH) != 0) {
            quality = PrintQuality.HIGH;
        } else {
            quality = PrintQuality.NORMAL;
        }
        setQualityAttrib(quality, attributes);
    }

    if ((fields & DM_DUPLEX) != 0) {
        Sides sides;
        if ((values & SET_DUP_VERTICAL) != 0) {
            sides = Sides.TWO_SIDED_LONG_EDGE;
        } else if ((values & SET_DUP_HORIZONTAL) != 0) {
            sides = Sides.TWO_SIDED_SHORT_EDGE;
        } else {
            sides = Sides.ONE_SIDED;
        }
        setSidesAttrib(sides, attributes);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:78,代码来源:WPrinterJob.java


示例8: setNativeAttributes

import sun.print.SunPageSelection; //导入依赖的package包/类
private void setNativeAttributes(int flags, int fields, int values) {
    if (attributes == null) {
        return;
    }
    if ((flags & PD_PRINTTOFILE) != 0) {
        Destination destPrn = (Destination)attributes.get(
                                             Destination.class);
        if (destPrn == null) {
            try {
                attributes.add(new Destination(
                                           new File("./out.prn").toURI()));
            } catch (SecurityException se) {
                try {
                    attributes.add(new Destination(
                                            new URI("file:out.prn")));
                } catch (URISyntaxException e) {
                }
            }
        }
    } else {
        attributes.remove(Destination.class);
    }

    if ((flags & PD_COLLATE) != 0) {
        setCollateAttrib(SheetCollate.COLLATED, attributes);
    } else {
        setCollateAttrib(SheetCollate.UNCOLLATED, attributes);
    }

    if ((flags & PD_NOSELECTION) != PD_NOSELECTION) {
        if ((flags & PD_PAGENUMS) != 0) {
            attributes.add(SunPageSelection.RANGE);
        } else if ((flags & PD_SELECTION) != 0) {
            attributes.add(SunPageSelection.SELECTION);
        } else {
            attributes.add(SunPageSelection.ALL);
        }
    }

    if ((fields & DM_ORIENTATION) != 0) {
        if ((values & SET_ORIENTATION) != 0) {
            setOrientAttrib(OrientationRequested.LANDSCAPE, attributes);
        } else {
            setOrientAttrib(OrientationRequested.PORTRAIT, attributes);
        }
    }

    if ((fields & DM_COLOR) != 0) {
        if ((values & SET_COLOR) != 0) {
            setColorAttrib(Chromaticity.COLOR, attributes);
        } else {
            setColorAttrib(Chromaticity.MONOCHROME, attributes);
        }
    }

    if ((fields & DM_PRINTQUALITY) != 0) {
        PrintQuality quality;
        if ((values & SET_RES_LOW) != 0) {
            quality = PrintQuality.DRAFT;
        } else if ((fields & SET_RES_HIGH) != 0) {
            quality = PrintQuality.HIGH;
        } else {
            quality = PrintQuality.NORMAL;
        }
        setQualityAttrib(quality, attributes);
    }

    if ((fields & DM_DUPLEX) != 0) {
        Sides sides;
        if ((values & SET_DUP_VERTICAL) != 0) {
            sides = Sides.TWO_SIDED_LONG_EDGE;
        } else if ((values & SET_DUP_HORIZONTAL) != 0) {
            sides = Sides.TWO_SIDED_SHORT_EDGE;
        } else {
            sides = Sides.ONE_SIDED;
        }
        setSidesAttrib(sides, attributes);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:80,代码来源:WPrinterJob.java


示例9: setNativeAttributes

import sun.print.SunPageSelection; //导入依赖的package包/类
private void setNativeAttributes(int flags, int fields, int values) {
    if (attributes == null) {
        return;
    }
    if ((flags & PD_PRINTTOFILE) != 0) {
        Destination destPrn = (Destination)attributes.get(
                                             Destination.class);
        if (destPrn == null) {
            try {
                attributes.add(new Destination(
                                           new File("./out.prn").toURI()));
            } catch (SecurityException se) {
                try {
                    attributes.add(new Destination(
                                            new URI("file:out.prn")));
                } catch (URISyntaxException e) {
                }
            }
        }
    } else {
        attributes.remove(Destination.class);
    }

    if ((flags & PD_COLLATE) != 0) {
        setCollateAttrib(SheetCollate.COLLATED, attributes);
    } else {
        setCollateAttrib(SheetCollate.UNCOLLATED, attributes);
    }

    if ((flags & PD_PAGENUMS) != 0) {
        attributes.add(SunPageSelection.RANGE);
    } else if ((flags & PD_SELECTION) != 0) {
        attributes.add(SunPageSelection.SELECTION);
    } else {
        attributes.add(SunPageSelection.ALL);
    }

    if ((fields & DM_ORIENTATION) != 0) {
        if ((values & SET_ORIENTATION) != 0) {
            setOrientAttrib(OrientationRequested.LANDSCAPE, attributes);
        } else {
            setOrientAttrib(OrientationRequested.PORTRAIT, attributes);
        }
    }

    if ((fields & DM_COLOR) != 0) {
        if ((values & SET_COLOR) != 0) {
            setColorAttrib(Chromaticity.COLOR, attributes);
        } else {
            setColorAttrib(Chromaticity.MONOCHROME, attributes);
        }
    }

    if ((fields & DM_PRINTQUALITY) != 0) {
        PrintQuality quality;
        if ((values & SET_RES_LOW) != 0) {
            quality = PrintQuality.DRAFT;
        } else if ((fields & SET_RES_HIGH) != 0) {
            quality = PrintQuality.HIGH;
        } else {
            quality = PrintQuality.NORMAL;
        }
        setQualityAttrib(quality, attributes);
    }

    if ((fields & DM_DUPLEX) != 0) {
        Sides sides;
        if ((values & SET_DUP_VERTICAL) != 0) {
            sides = Sides.TWO_SIDED_LONG_EDGE;
        } else if ((values & SET_DUP_HORIZONTAL) != 0) {
            sides = Sides.TWO_SIDED_SHORT_EDGE;
        } else {
            sides = Sides.ONE_SIDED;
        }
        setSidesAttrib(sides, attributes);
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:78,代码来源:WPrinterJob.java



注:本文中的sun.print.SunPageSelection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobStatus类代码示例发布时间:2022-05-21
下一篇:
Java PathConsumer2D类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap