本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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();
}
示例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();
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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;
}
}