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

Java PrintQuality类代码示例

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

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



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

示例1: setAttribute

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
public void setAttribute(final Attribute attr) {
    final Class<? extends Attribute> category = attr.getCategory();

    if (OrientationRequested.class.equals(category)) {
        setOrientation((OrientationRequested) attr);
    } else if (MediaSize.class.equals(category)) {
        setPaper((MediaSize) attr);
    } else if (Media.class.equals(category)) {
        setPaper((MediaSizeName) attr);
    } else if (Paper.class.equals(category)) {
        setPaper((Paper) attr);
    } else if (Copies.class.equals(category)) {
        setCopies((Copies) attr);
    } else if (PrintQuality.class.equals(category)) {
        setPrintQuality((PrintQuality) attr);
    } else if (Sides.class.equals(category)) {
        setSides((Sides) attr);
    } else if (SheetCollate.class.equals(category)) {
        setCollate((SheetCollate) attr);
    } else if (PrinterResolution.class.equals(category)) {
        setPrinterResolution((PrinterResolution) attr);
    } else if (Chromaticity.class.equals(category)) {
        setChromaticity((Chromaticity) attr);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:DevmodeStructWrapper.java


示例2: fillQualityFields

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
void fillQualityFields() {
    PrintQuality quality = (PrintQuality) attrs.get(PrintQuality.class);
    if (firstUse) {
        selectQualityButton(quality);
    }

    PrintQuality [] aList = (
            myService.isAttributeCategorySupported(PrintQuality.class) 
            ? (PrintQuality []) myService
                .getSupportedAttributeValues(PrintQuality.class, flavor, attrs)
            : null);
    enableQualityButtons(aList);    /* enable qualities which are supported */

    /* select quality */
    if ((aList != null) && (!qualityIsEnabled(getSelectedQuality()))) {
        selectQualityButton(qualityIsEnabled(quality) 
                ? quality 
                : (PrintQuality) (myService
                        .getDefaultAttributeValue(PrintQuality.class)));
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:ServiceUIDialog.java


示例3: enableQualityButtons

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
private void enableQualityButtons(PrintQuality [] list) {
    normalBtn.setEnabled(false);
    draftBtn.setEnabled(false);
    highBtn.setEnabled(false);
 
    if (list != null) {
        for (int i = 0; i < list.length; i++) {
            if (list[i].equals(PrintQuality.DRAFT)) {
                draftBtn.setEnabled(true);
            } else if (list[i].equals(PrintQuality.NORMAL)) {
                normalBtn.setEnabled(true);
            } else if (list[i].equals(PrintQuality.HIGH)) {
                highBtn.setEnabled(true);
            }
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:ServiceUIDialog.java


示例4: createPrintQualityCombo

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
private void createPrintQualityCombo(PrintRequestAttributeSet set) {
	PrintQuality[] qualities = (PrintQuality[]) mService.getSupportedAttributeValues(PrintQuality.class, DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
	if (qualities != null && qualities.length > 0) {
		HashSet<PrintQuality> possible = new HashSet<>();
		for (PrintQuality one : qualities) {
			possible.add(one);
		}
		ArrayList<Quality> choices = new ArrayList<>();
		for (Quality quality : Quality.values()) {
			if (possible.contains(quality.getPrintQuality())) {
				choices.add(quality);
			}
		}
		mPrintQuality = new JComboBox<>(choices.toArray(new Quality[0]));
		mPrintQuality.setSelectedItem(PrintUtilities.getPrintQuality(mService, set, true));
		UIUtilities.setOnlySize(mPrintQuality, mPrintQuality.getPreferredSize());
		LinkedLabel label = new LinkedLabel(QUALITY, mPrintQuality);
		add(label, new PrecisionLayoutData().setEndHorizontalAlignment());
		add(mPrintQuality);
	} else {
		mPrintQuality = null;
	}
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:24,代码来源:PageSetupPanel.java


示例5: showPrintSetupDialog

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Show a print setup dialog, to alter the ViewerModel's PageFormat
 *
 * @see ViewModel
 */
public void showPrintSetupDialog() {
    PrintHelper printHelper = viewModel.getPrintHelper();
    // create a new print helper for this document instance
    if (printHelper == null) {
        MediaSizeName mediaSizeName = loadDefaultPrinterProperties();
        // create the new print help
        printHelper = new PrintHelper(documentViewController.getViewContainer(),
                getPageTree(), documentViewController.getRotation(), mediaSizeName,
                PrintQuality.NORMAL);
    }
    // reuse previous print attributes if they exist. 
    else {
        printHelper = new PrintHelper(documentViewController.getViewContainer(),
                getPageTree(), documentViewController.getRotation(),
                printHelper.getDocAttributeSet(),
                printHelper.getPrintRequestAttributeSet());
    }
    viewModel.setPrintHelper(printHelper);
    viewModel.getPrintHelper().showPrintSetupDialog();
    // save new printer attributes to properties
    savePrinterProperties(printHelper);
}
 
开发者ID:pdf4j,项目名称:icepdf,代码行数:28,代码来源:SwingController.java


示例6: getSupportedAttributeCategories

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
public Class<?>[] getSupportedAttributeCategories() {
    ArrayList categList = new ArrayList(otherAttrCats.length+3);
    for (int i=0; i < otherAttrCats.length; i++) {
        categList.add(otherAttrCats[i]);
    }

    int caps = getPrinterCapabilities();

    if ((caps & DEVCAP_DUPLEX) != 0) {
        categList.add(Sides.class);
    }

    if ((caps & DEVCAP_QUALITY) != 0) {
        int[] defaults = getDefaultPrinterSettings();
        // Added check: if supported, we should be able to get the default.
        if ((defaults[3] >= DMRES_HIGH) && (defaults[3] < 0)) {
            categList.add(PrintQuality.class);
        }
    }

    PrinterResolution[] supportedRes = getPrintResolutions();
    if ((supportedRes!=null) && (supportedRes.length>0)) {
        categList.add(PrinterResolution.class);
    }

    return (Class[])categList.toArray(new Class[categList.size()]);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Win32PrintService.java


示例7: setQualityAttrib

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
private void setQualityAttrib(Attribute attr) {
    if (attr == PrintQuality.HIGH) {
        mAttQuality = -4; // DMRES_HIGH
    } else if (attr == PrintQuality.NORMAL) {
        mAttQuality = -3; // DMRES_MEDIUM
    } else {
        mAttQuality = -2; // DMRES_LOW
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:WPrinterJob.java


示例8: actionPerformed

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
@Override final public void actionPerformed(ActionEvent objPactionEvent) {
	final Object objPsourceObject = objPactionEvent.getSource();

	if (objPsourceObject == this.objGdraftJRadioButton) {
		this.objGprintJDialog.getAttributes().add(PrintQuality.DRAFT);
	} else if (objPsourceObject == this.objGnormalJRadioButton) {
		this.objGprintJDialog.getAttributes().add(PrintQuality.NORMAL);
	} else if (objPsourceObject == this.objGhighJRadioButton) {
		this.objGprintJDialog.getAttributes().add(PrintQuality.HIGH);
	}
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:12,代码来源:PrintQualitySubJPanel.java


示例9: getSupportedAttributeCategories

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
public Class<?>[] getSupportedAttributeCategories() {
    ArrayList<Class<?>> categList = new ArrayList<>(otherAttrCats.length+3);
    for (int i=0; i < otherAttrCats.length; i++) {
        categList.add(otherAttrCats[i]);
    }

    int caps = getPrinterCapabilities();

    if ((caps & DEVCAP_DUPLEX) != 0) {
        categList.add(Sides.class);
    }

    if ((caps & DEVCAP_QUALITY) != 0) {
        int[] defaults = getDefaultPrinterSettings();
        // Added check: if supported, we should be able to get the default.
        if ((defaults[3] >= DMRES_HIGH) && (defaults[3] < 0)) {
            categList.add(PrintQuality.class);
        }
    }

    PrinterResolution[] supportedRes = getPrintResolutions();
    if ((supportedRes!=null) && (supportedRes.length>0)) {
        categList.add(PrinterResolution.class);
    }

    return categList.toArray(new Class<?>[categList.size()]);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:Win32PrintService.java


示例10: getAssociatedAttributeArray

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Constructs an array from a set of -supported attributes.
 * @param set set to process
 * @return The constructed array.
 *
 * @see #getAssociatedAttribute()
 */
public static PrintQuality[] getAssociatedAttributeArray(Set<Attribute> set)
{
  PrintQuality[] result = new PrintQuality[set.size()];
  int j = 0;
  for (Attribute tmp : set)
    {
      result[j] = ((PrintQualitySupported) tmp).getAssociatedAttribute();
      j++;
    }
  return result;
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:PrintQualitySupported.java


示例11: write

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Writes an attribute in EnumSyntax into the stream.
 * @param attribute the attribute
 * @throws IOException if thrown by the stream
 */
private void write(EnumSyntax attribute) throws IOException
{
  // in JPS API enum syntax is used for enums, keyword and boolean types
  String name = ((Attribute) attribute).getName();

  // the enum value types
  if (attribute instanceof Finishings
      || attribute instanceof OrientationRequested
      || attribute instanceof PrintQuality)
    {
      out.writeByte(IppValueTag.ENUM);
      out.writeShort(name.length());
      out.write(name.getBytes());
      out.writeShort(4); // length, enum is 4 bytes
      out.writeInt(attribute.getValue());
    }
  // the boolean value type
  else if (attribute instanceof Fidelity)
    {
      out.writeByte(IppValueTag.BOOLEAN);
      out.writeShort(name.length());
      out.write(name.getBytes());
      out.writeShort(1); // length, boolean is 1 bytes
      out.writeByte(attribute.getValue() == 0 ? 0x00 : 0x01);
    }
  // the keyword value types
  else
    {
      String keyword = attribute.toString();
      out.writeByte(IppValueTag.KEYWORD);
      out.writeShort(name.length());
      out.write(name.getBytes());
      out.writeShort(keyword.length());
      out.write(keyword.getBytes());
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:42,代码来源:IppRequest.java


示例12: actionPerformed

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
public void actionPerformed(ActionEvent e)
{
  if (e.getSource() == low)
    atts.add(PrintQuality.DRAFT);
  else if (e.getSource() == normal)
    atts.add(PrintQuality.NORMAL);
  else
    atts.add(PrintQuality.HIGH);
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:PrinterDialog.java


示例13: updateForSelectedService

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  if (categorySupported(PrintQuality.class))
    {
      low.setEnabled(true);
      normal.setEnabled(true);
      high.setEnabled(true);

      Object defaultValue = defaultValue(PrintQuality.class);
      Attribute quality = attribute(PrintQuality.class);

      if (quality != null)
        {
          if (quality.equals(PrintQuality.DRAFT))
            low.setSelected(true);
          else if (quality.equals(PrintQuality.NORMAL))
            normal.setSelected(true);
          else
            high.setSelected(true);
        }
      else
        {
          if (defaultValue.equals(PrintQuality.DRAFT))
            low.setSelected(true);
          else if (defaultValue.equals(PrintQuality.NORMAL))
            normal.setSelected(true);
          else
            high.setSelected(true);
        }
    }
  else
    {
      low.setEnabled(false);
      normal.setEnabled(false);
      high.setEnabled(false);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:43,代码来源:PrinterDialog.java


示例14: getAssociatedAttributeArray

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Constructs an array from a set of -supported attributes.
 * @param set set to process
 * @return The constructed array.
 * 
 * @see #getAssociatedAttribute()
 */
public static PrintQuality[] getAssociatedAttributeArray(Set set) 
{
  PrintQualitySupported tmp;
  PrintQuality[] result = new PrintQuality[set.size()];      
  Iterator it = set.iterator();
  int j = 0;
  while (it.hasNext())
    {
      tmp = (PrintQualitySupported) it.next();
      result[j] = tmp.getAssociatedAttribute();
      j++;
    }            
  return result;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:22,代码来源:PrintQualitySupported.java


示例15: actionPerformed

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
public void actionPerformed(ActionEvent e)
{
  if (e.getSource() == low)
    atts.add(PrintQuality.DRAFT);
  else if (e.getSource() == normal)
    atts.add(PrintQuality.NORMAL);
  else
    atts.add(PrintQuality.HIGH);   
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:10,代码来源:PrinterDialog.java


示例16: updateForSelectedService

import javax.print.attribute.standard.PrintQuality; //导入依赖的package包/类
/**
 * Called to update for new selected
 * print service. Tests if currently
 * selected attributes are supported.
 */
void updateForSelectedService()
{
  if (categorySupported(PrintQuality.class))
    {
      low.setEnabled(true);
      normal.setEnabled(true);
      high.setEnabled(true);
      
      Object defaultValue = defaultValue(PrintQuality.class);          
      Attribute quality = attribute(PrintQuality.class);
      
      if (quality != null)
        {
          if (quality.equals(PrintQuality.DRAFT))
            low.setSelected(true);
          else if (quality.equals(PrintQuality.NORMAL))
            normal.setSelected(true);
          else 
            high.setSelected(true);
        }
      else
        {
          if (defaultValue.equals(PrintQuality.DRAFT))
            low.setSelected(true);
          else if (defaultValue.equals(PrintQuality.NORMAL))
            normal.setSelected(true);
          else 
            high.setSelected(true);
        }              
    }
  else
    {
      low.setEnabled(false);
      normal.setEnabled(false);
      high.setEnabled(false);
    }       
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:43,代码来源:PrinterDialog.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RecyclerListener类代码示例发布时间:2022-05-21
下一篇:
Java DynamicLongProperty类代码示例发布时间: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