当前位置: 首页>>代码示例>>Java>>正文


Java PageRanges.getMembers方法代码示例

本文整理汇总了Java中javax.print.attribute.standard.PageRanges.getMembers方法的典型用法代码示例。如果您正苦于以下问题:Java PageRanges.getMembers方法的具体用法?Java PageRanges.getMembers怎么用?Java PageRanges.getMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.print.attribute.standard.PageRanges的用法示例。


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

示例1: setAttributes

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
@Override
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException {
    super.setAttributes(attributes);

    if (attributes == null) {
        return;
    }

    PageRanges pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
    if (isSupportedValue(pageRangesAttr, attributes)) {
        SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
        // If rangeSelect is not null, we are using AWT's print dialog that has
        // All, Selection, and Range radio buttons
        if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
            int[][] range = pageRangesAttr.getMembers();
            // setPageRange will set firstPage and lastPage as called in getFirstPage
            // and getLastPage
            setPageRange(range[0][0] - 1, range[0][1] - 1);
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:22,代码来源:CPrinterJob.java

示例2: setAttributes

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
@Override
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException {
    super.setAttributes(attributes);

    if (attributes == null) {
        return;
    }

    PageRanges pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
    if (isSupportedValue(pageRangesAttr, attributes)) {
        SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
        // If rangeSelect is not null, we are using AWT's print dialog that has
        // All, Selection, and Range radio buttons
        if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
            int[][] range = pageRangesAttr.getMembers();
            // setPageRange will set firstPage and lastPage as called in getFirstPage
            // and getLastPage
            setPageRange(range[0][0] - 1, range[0][1] - 1);
        } else {
            // if rangeSelect is SunPageSelection.ALL
            // then setPageRange appropriately
            setPageRange(-1, -1);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:CPrinterJob.java

示例3: setAttributes

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException {
    super.setAttributes(attributes);

    if (attributes == null) {
        return;
    }

    // See if this has an NSPrintInfo in it.
    NSPrintInfo nsPrintInfo = (NSPrintInfo)attributes.get(NSPrintInfo.class);
    if (nsPrintInfo != null) {
        fNSPrintInfo = nsPrintInfo.getValue();
    }

    PageRanges pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
    if (isSupportedValue(pageRangesAttr, attributes)) {
        SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
        // If rangeSelect is not null, we are using AWT's print dialog that has
        // All, Selection, and Range radio buttons
        if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
            int[][] range = pageRangesAttr.getMembers();
            // setPageRange will set firstPage and lastPage as called in getFirstPage
            // and getLastPage
            setPageRange(range[0][0] - 1, range[0][1] - 1);
        }
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:27,代码来源:CPrinterJob.java

示例4: fillPrintRangeFields

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
void fillPrintRangeFields() {
    if (firstUse) {
        if (attrs.containsKey(PageRanges.class)) {
            PageRanges aRange = (PageRanges) (attrs.get(PageRanges.class));
            int [][] range = aRange.getMembers();
            fromTxt.setText(range.length > 0 
                    ? Integer.toString(range[0][0]) : "1");
            toTxt.setText(range.length > 0 
                    ? Integer.toString(range[0][1]) : "1");
            pageRngBtn.setSelected(true);
        } else {
            allRngBtn.setSelected(true);
            fromTxt.setEnabled(false);
            toTxt.setEnabled(false);
            fromTxt.setText("1");
            toTxt.setText("1");
            toLabel.setEnabled(false);
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:ServiceUIDialog.java

示例5: getFromPageAttrib

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
protected final int getFromPageAttrib() {
    if (attributes != null) {
        PageRanges pageRangesAttr =
            (PageRanges)attributes.get(PageRanges.class);
        if (pageRangesAttr != null) {
            int[][] range = pageRangesAttr.getMembers();
            return range[0][0];
        }
    }
    return getMinPageAttrib();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:RasterPrinterJob.java

示例6: getToPageAttrib

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
protected final int getToPageAttrib() {
    if (attributes != null) {
        PageRanges pageRangesAttr =
            (PageRanges)attributes.get(PageRanges.class);
        if (pageRangesAttr != null) {
            int[][] range = pageRangesAttr.getMembers();
            return range[range.length-1][1];
        }
    }
    return getMaxPageAttrib();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:RasterPrinterJob.java

示例7: setAttributes

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
@Override
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException {
    super.setAttributes(attributes);

    if (attributes == null) {
        return;
    }

    // See if this has an NSPrintInfo in it.
    NSPrintInfo nsPrintInfo = (NSPrintInfo)attributes.get(NSPrintInfo.class);
    if (nsPrintInfo != null) {
        fNSPrintInfo = nsPrintInfo.getValue();
    }

    PageRanges pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
    if (isSupportedValue(pageRangesAttr, attributes)) {
        SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
        // If rangeSelect is not null, we are using AWT's print dialog that has
        // All, Selection, and Range radio buttons
        if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
            int[][] range = pageRangesAttr.getMembers();
            // setPageRange will set firstPage and lastPage as called in getFirstPage
            // and getLastPage
            setPageRange(range[0][0] - 1, range[0][1] - 1);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:CPrinterJob.java

示例8: setValues

import javax.print.attribute.standard.PageRanges; //导入方法依赖的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

示例9: setAttributes

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
@Override
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException {
    super.setAttributes(attributes);

    if (attributes == null) {
        return;
    }

    // See if this has an NSPrintInfo in it.
    NSPrintInfo nsPrintInfo = (NSPrintInfo)attributes.get(NSPrintInfo.class);
    if (nsPrintInfo != null) {
        fNSPrintInfo = nsPrintInfo.getValue();
    }

    PageRanges pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
    if (isSupportedValue(pageRangesAttr, attributes)) {
        SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class);
        // If rangeSelect is not null, we are using AWT's print dialog that has
        // All, Selection, and Range radio buttons
        if (rangeSelect == null || rangeSelect == SunPageSelection.RANGE) {
            int[][] range = pageRangesAttr.getMembers();
            // setPageRange will set firstPage and lastPage as called in getFirstPage
            // and getLastPage
            setPageRange(range[0][0] - 1, range[0][1] - 1);
        } else {
            // if rangeSelect is SunPageSelection.ALL
            // then setPageRange appropriately
            setPageRange(-1, -1);
        }
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:32,代码来源:CPrinterJob.java

示例10: updateForSelectedService

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  if (categorySupported(PageRanges.class))
    {
      pages_rb.setEnabled(true);
      PageRanges range = (PageRanges) attribute(PageRanges.class);
      if (range != null)
        {
          from_tf.setEnabled(true);
          to.setEnabled(true);
          to_tf.setEnabled(true);
          all_rb.setSelected(false);
          pages_rb.setSelected(true);

          int[][] members = range.getMembers();
          // Although passed in attributes may contain more than one
          // range we only take the first one
          from_tf.setText("" + members[0][0]);
          to_tf.setText("" + members[0][1]);
        }
    }
  else
    {
      from_tf.setEnabled(false);
      to.setEnabled(false);
      to_tf.setEnabled(false);
      all_rb.setSelected(true);
    }
 }
 
开发者ID:vilie,项目名称:javify,代码行数:35,代码来源:PrinterDialog.java

示例11: updateForSelectedService

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  if (categorySupported(PageRanges.class))
    {
      pages_rb.setEnabled(true);
      PageRanges range = (PageRanges) attribute(PageRanges.class);
      if (range != null)
        {
          from_tf.setEnabled(true);
          to.setEnabled(true);
          to_tf.setEnabled(true);   
          all_rb.setSelected(false);
          pages_rb.setSelected(true);
          
          int[][] members = range.getMembers();
          // Although passed in attributes may contain more than one 
          // range we only take the first one
          from_tf.setText("" + members[0][0]);
          to_tf.setText("" + members[0][1]);
        }
    }
  else
    {
      from_tf.setEnabled(false);
      to.setEnabled(false);
      to_tf.setEnabled(false);
      all_rb.setSelected(true);
    }
 }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:35,代码来源:PrinterDialog.java

示例12: getFromPageAttrib

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
private final int getFromPageAttrib() {
    if (attributes != null) {
        PageRanges pageRangesAttr =
            (PageRanges)attributes.get(PageRanges.class);
        if (pageRangesAttr != null) {
            int[][] range = pageRangesAttr.getMembers();
            return range[0][0];
        }
    }
    return getMinPageAttrib();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:12,代码来源:WPrinterJob.java

示例13: getToPageAttrib

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
private final int getToPageAttrib() {
    if (attributes != null) {
        PageRanges pageRangesAttr =
            (PageRanges)attributes.get(PageRanges.class);
        if (pageRangesAttr != null) {
            int[][] range = pageRangesAttr.getMembers();
            return range[range.length-1][1];
        }
    }
    return getMaxPageAttrib();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:12,代码来源:WPrinterJob.java

示例14: createPageRangeFields

import javax.print.attribute.standard.PageRanges; //导入方法依赖的package包/类
private void createPageRangeFields(PrintRequestAttributeSet set) {
	PrintService service = getService();
	if (service.isAttributeCategorySupported(PageRanges.class)) {
		ButtonGroup group = new ButtonGroup();
		int start = 1;
		int end = 9999;
		PageRanges pageRanges = (PageRanges) set.get(PageRanges.class);
		if (pageRanges != null) {
			int[][] ranges = pageRanges.getMembers();
			if (ranges.length > 0 && ranges[0].length > 1) {
				start = ranges[0][0];
				end = ranges[0][1];
			} else {
				pageRanges = null;
			}
		}
		JLabel label = new JLabel(PAGE_RANGE, SwingConstants.CENTER);
		add(label, new PrecisionLayoutData().setEndHorizontalAlignment());
		JPanel wrapper = new JPanel(new PrecisionLayout().setMargins(0).setColumns(5));
		mPageRangeAll = new JRadioButton(ALL, pageRanges == null);
		wrapper.add(mPageRangeAll);
		mPageRangeSome = new JRadioButton(PAGES, pageRanges != null);
		wrapper.add(mPageRangeSome);
		mPageRangeStart = createPageRangeField(start, wrapper);
		wrapper.add(new JLabel(TO, SwingConstants.CENTER));
		mPageRangeEnd = createPageRangeField(end, wrapper);
		add(wrapper);
		group.add(mPageRangeAll);
		group.add(mPageRangeSome);
		adjustPageRanges();
		mPageRangeAll.addActionListener(this);
		mPageRangeSome.addActionListener(this);
	} else {
		mPageRangeAll = null;
		mPageRangeSome = null;
		mPageRangeStart = null;
		mPageRangeEnd = null;
	}
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:40,代码来源:PrintPanel.java


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